Class: Azure::SQL::Mgmt::V2015_05_01_preview::SyncGroups

Inherits:
Object
  • Object
show all
Includes:
MsRestAzure
Defined in:
lib/2015-05-01-preview/generated/azure_mgmt_sql/sync_groups.rb

Overview

The Azure SQL Database management API provides a RESTful set of web services that interact with Azure SQL Database services to manage your databases. The API enables you to create, retrieve, update, and delete databases.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ SyncGroups

Creates and initializes a new instance of the SyncGroups class.

Parameters:

  • client

    service class for accessing basic functionality.



20
21
22
# File 'lib/2015-05-01-preview/generated/azure_mgmt_sql/sync_groups.rb', line 20

def initialize(client)
  @client = client
end

Instance Attribute Details

#clientSqlManagementClient (readonly)

Returns reference to the SqlManagementClient.

Returns:



25
26
27
# File 'lib/2015-05-01-preview/generated/azure_mgmt_sql/sync_groups.rb', line 25

def client
  @client
end

Instance Method Details

#begin_create_or_update(resource_group_name, server_name, database_name, sync_group_name, parameters, custom_headers = nil) ⇒ SyncGroup

Creates or updates a sync group.

contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. group is hosted. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group that

  • server_name (String)

    The name of the server.

  • database_name (String)

    The name of the database on which the sync

  • sync_group_name (String)

    The name of the sync group.

  • parameters (SyncGroup)

    The requested sync group resource state.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (SyncGroup)

    operation results.



1074
1075
1076
1077
# File 'lib/2015-05-01-preview/generated/azure_mgmt_sql/sync_groups.rb', line 1074

def begin_create_or_update(resource_group_name, server_name, database_name, sync_group_name, parameters, custom_headers = nil)
  response = begin_create_or_update_async(resource_group_name, server_name, database_name, sync_group_name, parameters, custom_headers).value!
  response.body unless response.nil?
end

#begin_create_or_update_async(resource_group_name, server_name, database_name, sync_group_name, parameters, custom_headers = nil) ⇒ Concurrent::Promise

Creates or updates a sync group.

contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. group is hosted. to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group that

  • server_name (String)

    The name of the server.

  • database_name (String)

    The name of the database on which the sync

  • sync_group_name (String)

    The name of the sync group.

  • parameters (SyncGroup)

    The requested sync group resource state.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
# File 'lib/2015-05-01-preview/generated/azure_mgmt_sql/sync_groups.rb', line 1115

def begin_create_or_update_async(resource_group_name, server_name, database_name, sync_group_name, parameters, custom_headers = nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, 'server_name is nil' if server_name.nil?
  fail ArgumentError, 'database_name is nil' if database_name.nil?
  fail ArgumentError, 'sync_group_name is nil' if sync_group_name.nil?
  fail ArgumentError, 'parameters is nil' if parameters.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?


  request_headers = {}

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?

  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Serialize Request
  request_mapper = Azure::SQL::Mgmt::V2015_05_01_preview::Models::SyncGroup.mapper()
  request_content = @client.serialize(request_mapper,  parameters)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'resourceGroupName' => resource_group_name,'serverName' => server_name,'databaseName' => database_name,'syncGroupName' => sync_group_name,'subscriptionId' => @client.subscription_id},
      query_params: {'api-version' => @client.api_version},
      body: request_content,
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:put, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200 || status_code == 202 || status_code == 201
      error_model = JSON.load(response_content)
      fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::SQL::Mgmt::V2015_05_01_preview::Models::SyncGroup.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end
    # Deserialize Response
    if status_code == 201
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::SQL::Mgmt::V2015_05_01_preview::Models::SyncGroup.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#begin_create_or_update_with_http_info(resource_group_name, server_name, database_name, sync_group_name, parameters, custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse

Creates or updates a sync group.

contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. group is hosted. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group that

  • server_name (String)

    The name of the server.

  • database_name (String)

    The name of the database on which the sync

  • sync_group_name (String)

    The name of the sync group.

  • parameters (SyncGroup)

    The requested sync group resource state.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



1095
1096
1097
# File 'lib/2015-05-01-preview/generated/azure_mgmt_sql/sync_groups.rb', line 1095

def begin_create_or_update_with_http_info(resource_group_name, server_name, database_name, sync_group_name, parameters, custom_headers = nil)
  begin_create_or_update_async(resource_group_name, server_name, database_name, sync_group_name, parameters, custom_headers).value!
end

#begin_delete(resource_group_name, server_name, database_name, sync_group_name, custom_headers = nil) ⇒ Object

Deletes a sync group.

contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. group is hosted. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group that

  • server_name (String)

    The name of the server.

  • database_name (String)

    The name of the database on which the sync

  • sync_group_name (String)

    The name of the sync group.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that



1203
1204
1205
1206
# File 'lib/2015-05-01-preview/generated/azure_mgmt_sql/sync_groups.rb', line 1203

def begin_delete(resource_group_name, server_name, database_name, sync_group_name, custom_headers = nil)
  response = begin_delete_async(resource_group_name, server_name, database_name, sync_group_name, custom_headers).value!
  nil
end

#begin_delete_async(resource_group_name, server_name, database_name, sync_group_name, custom_headers = nil) ⇒ Concurrent::Promise

Deletes a sync group.

contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. group is hosted. to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group that

  • server_name (String)

    The name of the server.

  • database_name (String)

    The name of the database on which the sync

  • sync_group_name (String)

    The name of the sync group.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
# File 'lib/2015-05-01-preview/generated/azure_mgmt_sql/sync_groups.rb', line 1242

def begin_delete_async(resource_group_name, server_name, database_name, sync_group_name, custom_headers = nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, 'server_name is nil' if server_name.nil?
  fail ArgumentError, 'database_name is nil' if database_name.nil?
  fail ArgumentError, 'sync_group_name is nil' if sync_group_name.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?


  request_headers = {}

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'resourceGroupName' => resource_group_name,'serverName' => server_name,'databaseName' => database_name,'syncGroupName' => sync_group_name,'subscriptionId' => @client.subscription_id},
      query_params: {'api-version' => @client.api_version},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:delete, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200 || status_code == 202 || status_code == 204
      error_model = JSON.load(response_content)
      fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?

    result
  end

  promise.execute
end

#begin_delete_with_http_info(resource_group_name, server_name, database_name, sync_group_name, custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse

Deletes a sync group.

contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. group is hosted. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group that

  • server_name (String)

    The name of the server.

  • database_name (String)

    The name of the database on which the sync

  • sync_group_name (String)

    The name of the sync group.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



1223
1224
1225
# File 'lib/2015-05-01-preview/generated/azure_mgmt_sql/sync_groups.rb', line 1223

def begin_delete_with_http_info(resource_group_name, server_name, database_name, sync_group_name, custom_headers = nil)
  begin_delete_async(resource_group_name, server_name, database_name, sync_group_name, custom_headers).value!
end

#begin_refresh_hub_schema(resource_group_name, server_name, database_name, sync_group_name, custom_headers = nil) ⇒ Object

Refreshes a hub database schema.

contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. group is hosted. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group that

  • server_name (String)

    The name of the server.

  • database_name (String)

    The name of the database on which the sync

  • sync_group_name (String)

    The name of the sync group.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that



975
976
977
978
# File 'lib/2015-05-01-preview/generated/azure_mgmt_sql/sync_groups.rb', line 975

def begin_refresh_hub_schema(resource_group_name, server_name, database_name, sync_group_name, custom_headers = nil)
  response = begin_refresh_hub_schema_async(resource_group_name, server_name, database_name, sync_group_name, custom_headers).value!
  nil
end

#begin_refresh_hub_schema_async(resource_group_name, server_name, database_name, sync_group_name, custom_headers = nil) ⇒ Concurrent::Promise

Refreshes a hub database schema.

contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. group is hosted. to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group that

  • server_name (String)

    The name of the server.

  • database_name (String)

    The name of the database on which the sync

  • sync_group_name (String)

    The name of the sync group.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
# File 'lib/2015-05-01-preview/generated/azure_mgmt_sql/sync_groups.rb', line 1014

def begin_refresh_hub_schema_async(resource_group_name, server_name, database_name, sync_group_name, custom_headers = nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, 'server_name is nil' if server_name.nil?
  fail ArgumentError, 'database_name is nil' if database_name.nil?
  fail ArgumentError, 'sync_group_name is nil' if sync_group_name.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?


  request_headers = {}

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/refreshHubSchema'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'resourceGroupName' => resource_group_name,'serverName' => server_name,'databaseName' => database_name,'syncGroupName' => sync_group_name,'subscriptionId' => @client.subscription_id},
      query_params: {'api-version' => @client.api_version},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:post, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200 || status_code == 202
      error_model = JSON.load(response_content)
      fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?

    result
  end

  promise.execute
end

#begin_refresh_hub_schema_with_http_info(resource_group_name, server_name, database_name, sync_group_name, custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse

Refreshes a hub database schema.

contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. group is hosted. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group that

  • server_name (String)

    The name of the server.

  • database_name (String)

    The name of the database on which the sync

  • sync_group_name (String)

    The name of the sync group.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



995
996
997
# File 'lib/2015-05-01-preview/generated/azure_mgmt_sql/sync_groups.rb', line 995

def begin_refresh_hub_schema_with_http_info(resource_group_name, server_name, database_name, sync_group_name, custom_headers = nil)
  begin_refresh_hub_schema_async(resource_group_name, server_name, database_name, sync_group_name, custom_headers).value!
end

#begin_update(resource_group_name, server_name, database_name, sync_group_name, parameters, custom_headers = nil) ⇒ SyncGroup

Updates a sync group.

contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. group is hosted. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group that

  • server_name (String)

    The name of the server.

  • database_name (String)

    The name of the database on which the sync

  • sync_group_name (String)

    The name of the sync group.

  • parameters (SyncGroup)

    The requested sync group resource state.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (SyncGroup)

    operation results.



1302
1303
1304
1305
# File 'lib/2015-05-01-preview/generated/azure_mgmt_sql/sync_groups.rb', line 1302

def begin_update(resource_group_name, server_name, database_name, sync_group_name, parameters, custom_headers = nil)
  response = begin_update_async(resource_group_name, server_name, database_name, sync_group_name, parameters, custom_headers).value!
  response.body unless response.nil?
end

#begin_update_async(resource_group_name, server_name, database_name, sync_group_name, parameters, custom_headers = nil) ⇒ Concurrent::Promise

Updates a sync group.

contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. group is hosted. to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group that

  • server_name (String)

    The name of the server.

  • database_name (String)

    The name of the database on which the sync

  • sync_group_name (String)

    The name of the sync group.

  • parameters (SyncGroup)

    The requested sync group resource state.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
# File 'lib/2015-05-01-preview/generated/azure_mgmt_sql/sync_groups.rb', line 1343

def begin_update_async(resource_group_name, server_name, database_name, sync_group_name, parameters, custom_headers = nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, 'server_name is nil' if server_name.nil?
  fail ArgumentError, 'database_name is nil' if database_name.nil?
  fail ArgumentError, 'sync_group_name is nil' if sync_group_name.nil?
  fail ArgumentError, 'parameters is nil' if parameters.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?


  request_headers = {}

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?

  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Serialize Request
  request_mapper = Azure::SQL::Mgmt::V2015_05_01_preview::Models::SyncGroup.mapper()
  request_content = @client.serialize(request_mapper,  parameters)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'resourceGroupName' => resource_group_name,'serverName' => server_name,'databaseName' => database_name,'syncGroupName' => sync_group_name,'subscriptionId' => @client.subscription_id},
      query_params: {'api-version' => @client.api_version},
      body: request_content,
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:patch, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200 || status_code == 202
      error_model = JSON.load(response_content)
      fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::SQL::Mgmt::V2015_05_01_preview::Models::SyncGroup.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#begin_update_with_http_info(resource_group_name, server_name, database_name, sync_group_name, parameters, custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse

Updates a sync group.

contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. group is hosted. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group that

  • server_name (String)

    The name of the server.

  • database_name (String)

    The name of the database on which the sync

  • sync_group_name (String)

    The name of the sync group.

  • parameters (SyncGroup)

    The requested sync group resource state.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



1323
1324
1325
# File 'lib/2015-05-01-preview/generated/azure_mgmt_sql/sync_groups.rb', line 1323

def begin_update_with_http_info(resource_group_name, server_name, database_name, sync_group_name, parameters, custom_headers = nil)
  begin_update_async(resource_group_name, server_name, database_name, sync_group_name, parameters, custom_headers).value!
end

#cancel_sync(resource_group_name, server_name, database_name, sync_group_name, custom_headers = nil) ⇒ Object

Cancels a sync group synchronization.

contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. group is hosted. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group that

  • server_name (String)

    The name of the server.

  • database_name (String)

    The name of the database on which the sync

  • sync_group_name (String)

    The name of the sync group.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that



413
414
415
416
# File 'lib/2015-05-01-preview/generated/azure_mgmt_sql/sync_groups.rb', line 413

def cancel_sync(resource_group_name, server_name, database_name, sync_group_name, custom_headers = nil)
  response = cancel_sync_async(resource_group_name, server_name, database_name, sync_group_name, custom_headers).value!
  nil
end

#cancel_sync_async(resource_group_name, server_name, database_name, sync_group_name, custom_headers = nil) ⇒ Concurrent::Promise

Cancels a sync group synchronization.

contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. group is hosted. to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group that

  • server_name (String)

    The name of the server.

  • database_name (String)

    The name of the database on which the sync

  • sync_group_name (String)

    The name of the sync group.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
# File 'lib/2015-05-01-preview/generated/azure_mgmt_sql/sync_groups.rb', line 452

def cancel_sync_async(resource_group_name, server_name, database_name, sync_group_name, custom_headers = nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, 'server_name is nil' if server_name.nil?
  fail ArgumentError, 'database_name is nil' if database_name.nil?
  fail ArgumentError, 'sync_group_name is nil' if sync_group_name.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?


  request_headers = {}

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/cancelSync'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'resourceGroupName' => resource_group_name,'serverName' => server_name,'databaseName' => database_name,'syncGroupName' => sync_group_name,'subscriptionId' => @client.subscription_id},
      query_params: {'api-version' => @client.api_version},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:post, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?

    result
  end

  promise.execute
end

#cancel_sync_with_http_info(resource_group_name, server_name, database_name, sync_group_name, custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse

Cancels a sync group synchronization.

contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. group is hosted. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group that

  • server_name (String)

    The name of the server.

  • database_name (String)

    The name of the database on which the sync

  • sync_group_name (String)

    The name of the sync group.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



433
434
435
# File 'lib/2015-05-01-preview/generated/azure_mgmt_sql/sync_groups.rb', line 433

def cancel_sync_with_http_info(resource_group_name, server_name, database_name, sync_group_name, custom_headers = nil)
  cancel_sync_async(resource_group_name, server_name, database_name, sync_group_name, custom_headers).value!
end

#create_or_update(resource_group_name, server_name, database_name, sync_group_name, parameters, custom_headers = nil) ⇒ SyncGroup

Creates or updates a sync group.

contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. group is hosted. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group that

  • server_name (String)

    The name of the server.

  • database_name (String)

    The name of the database on which the sync

  • sync_group_name (String)

    The name of the sync group.

  • parameters (SyncGroup)

    The requested sync group resource state.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (SyncGroup)

    operation results.



717
718
719
720
# File 'lib/2015-05-01-preview/generated/azure_mgmt_sql/sync_groups.rb', line 717

def create_or_update(resource_group_name, server_name, database_name, sync_group_name, parameters, custom_headers = nil)
  response = create_or_update_async(resource_group_name, server_name, database_name, sync_group_name, parameters, custom_headers).value!
  response.body unless response.nil?
end

#create_or_update_async(resource_group_name, server_name, database_name, sync_group_name, parameters, custom_headers = nil) ⇒ Concurrent::Promise

contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. group is hosted. will be added to the HTTP request.

response.

Parameters:

  • resource_group_name (String)

    The name of the resource group that

  • server_name (String)

    The name of the server.

  • database_name (String)

    The name of the database on which the sync

  • sync_group_name (String)

    The name of the sync group.

  • parameters (SyncGroup)

    The requested sync group resource state.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (Concurrent::Promise)

    promise which provides async access to http



737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
# File 'lib/2015-05-01-preview/generated/azure_mgmt_sql/sync_groups.rb', line 737

def create_or_update_async(resource_group_name, server_name, database_name, sync_group_name, parameters, custom_headers = nil)
  # Send request
  promise = begin_create_or_update_async(resource_group_name, server_name, database_name, sync_group_name, parameters, custom_headers)

  promise = promise.then do |response|
    # Defining deserialization method.
    deserialize_method = lambda do |parsed_response|
      result_mapper = Azure::SQL::Mgmt::V2015_05_01_preview::Models::SyncGroup.mapper()
      parsed_response = @client.deserialize(result_mapper, parsed_response)
    end

    # Waiting for response.
    @client.get_long_running_operation_result(response, deserialize_method)
  end

  promise
end

#delete(resource_group_name, server_name, database_name, sync_group_name, custom_headers = nil) ⇒ Object

Deletes a sync group.

contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. group is hosted. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group that

  • server_name (String)

    The name of the server.

  • database_name (String)

    The name of the database on which the sync

  • sync_group_name (String)

    The name of the sync group.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that



768
769
770
771
# File 'lib/2015-05-01-preview/generated/azure_mgmt_sql/sync_groups.rb', line 768

def delete(resource_group_name, server_name, database_name, sync_group_name, custom_headers = nil)
  response = delete_async(resource_group_name, server_name, database_name, sync_group_name, custom_headers).value!
  nil
end

#delete_async(resource_group_name, server_name, database_name, sync_group_name, custom_headers = nil) ⇒ Concurrent::Promise

contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. group is hosted. will be added to the HTTP request.

response.

Parameters:

  • resource_group_name (String)

    The name of the resource group that

  • server_name (String)

    The name of the server.

  • database_name (String)

    The name of the database on which the sync

  • sync_group_name (String)

    The name of the sync group.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (Concurrent::Promise)

    promise which provides async access to http



787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
# File 'lib/2015-05-01-preview/generated/azure_mgmt_sql/sync_groups.rb', line 787

def delete_async(resource_group_name, server_name, database_name, sync_group_name, custom_headers = nil)
  # Send request
  promise = begin_delete_async(resource_group_name, server_name, database_name, sync_group_name, custom_headers)

  promise = promise.then do |response|
    # Defining deserialization method.
    deserialize_method = lambda do |parsed_response|
    end

    # Waiting for response.
    @client.get_long_running_operation_result(response, deserialize_method)
  end

  promise
end

#get(resource_group_name, server_name, database_name, sync_group_name, custom_headers = nil) ⇒ SyncGroup

Gets a sync group.

contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. group is hosted. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group that

  • server_name (String)

    The name of the server.

  • database_name (String)

    The name of the database on which the sync

  • sync_group_name (String)

    The name of the sync group.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (SyncGroup)

    operation results.



608
609
610
611
# File 'lib/2015-05-01-preview/generated/azure_mgmt_sql/sync_groups.rb', line 608

def get(resource_group_name, server_name, database_name, sync_group_name, custom_headers = nil)
  response = get_async(resource_group_name, server_name, database_name, sync_group_name, custom_headers).value!
  response.body unless response.nil?
end

#get_async(resource_group_name, server_name, database_name, sync_group_name, custom_headers = nil) ⇒ Concurrent::Promise

Gets a sync group.

contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. group is hosted. to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group that

  • server_name (String)

    The name of the server.

  • database_name (String)

    The name of the database on which the sync

  • sync_group_name (String)

    The name of the sync group.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
# File 'lib/2015-05-01-preview/generated/azure_mgmt_sql/sync_groups.rb', line 647

def get_async(resource_group_name, server_name, database_name, sync_group_name, custom_headers = nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, 'server_name is nil' if server_name.nil?
  fail ArgumentError, 'database_name is nil' if database_name.nil?
  fail ArgumentError, 'sync_group_name is nil' if sync_group_name.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?


  request_headers = {}

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'resourceGroupName' => resource_group_name,'serverName' => server_name,'databaseName' => database_name,'syncGroupName' => sync_group_name,'subscriptionId' => @client.subscription_id},
      query_params: {'api-version' => @client.api_version},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:get, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::SQL::Mgmt::V2015_05_01_preview::Models::SyncGroup.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#get_with_http_info(resource_group_name, server_name, database_name, sync_group_name, custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse

Gets a sync group.

contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. group is hosted. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group that

  • server_name (String)

    The name of the server.

  • database_name (String)

    The name of the database on which the sync

  • sync_group_name (String)

    The name of the sync group.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



628
629
630
# File 'lib/2015-05-01-preview/generated/azure_mgmt_sql/sync_groups.rb', line 628

def get_with_http_info(resource_group_name, server_name, database_name, sync_group_name, custom_headers = nil)
  get_async(resource_group_name, server_name, database_name, sync_group_name, custom_headers).value!
end

#list_by_database(resource_group_name, server_name, database_name, custom_headers = nil) ⇒ Array<SyncGroup>

Lists sync groups under a hub database.

contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. group is hosted. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group that

  • server_name (String)

    The name of the server.

  • database_name (String)

    The name of the database on which the sync

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (Array<SyncGroup>)

    operation results.



871
872
873
874
# File 'lib/2015-05-01-preview/generated/azure_mgmt_sql/sync_groups.rb', line 871

def list_by_database(resource_group_name, server_name, database_name, custom_headers = nil)
  first_page = list_by_database_as_lazy(resource_group_name, server_name, database_name, custom_headers)
  first_page.get_all_items
end

#list_by_database_as_lazy(resource_group_name, server_name, database_name, custom_headers = nil) ⇒ SyncGroupListResult

Lists sync groups under a hub database.

contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. group is hosted. will be added to the HTTP request.

response.

Parameters:

  • resource_group_name (String)

    The name of the resource group that

  • server_name (String)

    The name of the server.

  • database_name (String)

    The name of the database on which the sync

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (SyncGroupListResult)

    which provide lazy access to pages of the



1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
# File 'lib/2015-05-01-preview/generated/azure_mgmt_sql/sync_groups.rb', line 1851

def list_by_database_as_lazy(resource_group_name, server_name, database_name, custom_headers = nil)
  response = list_by_database_async(resource_group_name, server_name, database_name, custom_headers).value!
  unless response.nil?
    page = response.body
    page.next_method = Proc.new do |next_page_link|
      list_by_database_next_async(next_page_link, custom_headers)
    end
    page
  end
end

#list_by_database_async(resource_group_name, server_name, database_name, custom_headers = nil) ⇒ Concurrent::Promise

Lists sync groups under a hub database.

contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. group is hosted. to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group that

  • server_name (String)

    The name of the server.

  • database_name (String)

    The name of the database on which the sync

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
# File 'lib/2015-05-01-preview/generated/azure_mgmt_sql/sync_groups.rb', line 908

def list_by_database_async(resource_group_name, server_name, database_name, custom_headers = nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, 'server_name is nil' if server_name.nil?
  fail ArgumentError, 'database_name is nil' if database_name.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?


  request_headers = {}

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'resourceGroupName' => resource_group_name,'serverName' => server_name,'databaseName' => database_name,'subscriptionId' => @client.subscription_id},
      query_params: {'api-version' => @client.api_version},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:get, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::SQL::Mgmt::V2015_05_01_preview::Models::SyncGroupListResult.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#list_by_database_next(next_page_link, custom_headers = nil) ⇒ SyncGroupListResult

Lists sync groups under a hub database.

to List operation. will be added to the HTTP request.

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (SyncGroupListResult)

    operation results.



1678
1679
1680
1681
# File 'lib/2015-05-01-preview/generated/azure_mgmt_sql/sync_groups.rb', line 1678

def list_by_database_next(next_page_link, custom_headers = nil)
  response = list_by_database_next_async(next_page_link, custom_headers).value!
  response.body unless response.nil?
end

#list_by_database_next_async(next_page_link, custom_headers = nil) ⇒ Concurrent::Promise

Lists sync groups under a hub database.

to List operation. to the HTTP request.

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
# File 'lib/2015-05-01-preview/generated/azure_mgmt_sql/sync_groups.rb', line 1707

def list_by_database_next_async(next_page_link, custom_headers = nil)
  fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?


  request_headers = {}

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = '{nextLink}'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      skip_encoding_path_params: {'nextLink' => next_page_link},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:get, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::SQL::Mgmt::V2015_05_01_preview::Models::SyncGroupListResult.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#list_by_database_next_with_http_info(next_page_link, custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse

Lists sync groups under a hub database.

to List operation. will be added to the HTTP request.

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



1693
1694
1695
# File 'lib/2015-05-01-preview/generated/azure_mgmt_sql/sync_groups.rb', line 1693

def list_by_database_next_with_http_info(next_page_link, custom_headers = nil)
  list_by_database_next_async(next_page_link, custom_headers).value!
end

#list_by_database_with_http_info(resource_group_name, server_name, database_name, custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse

Lists sync groups under a hub database.

contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. group is hosted. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group that

  • server_name (String)

    The name of the server.

  • database_name (String)

    The name of the database on which the sync

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



890
891
892
# File 'lib/2015-05-01-preview/generated/azure_mgmt_sql/sync_groups.rb', line 890

def list_by_database_with_http_info(resource_group_name, server_name, database_name, custom_headers = nil)
  list_by_database_async(resource_group_name, server_name, database_name, custom_headers).value!
end

#list_hub_schemas(resource_group_name, server_name, database_name, sync_group_name, custom_headers = nil) ⇒ Array<SyncFullSchemaProperties>

Gets a collection of hub database schemas.

contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. group is hosted. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group that

  • server_name (String)

    The name of the server.

  • database_name (String)

    The name of the database on which the sync

  • sync_group_name (String)

    The name of the sync group.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (Array<SyncFullSchemaProperties>)

    operation results.



180
181
182
183
# File 'lib/2015-05-01-preview/generated/azure_mgmt_sql/sync_groups.rb', line 180

def list_hub_schemas(resource_group_name, server_name, database_name, sync_group_name, custom_headers = nil)
  first_page = list_hub_schemas_as_lazy(resource_group_name, server_name, database_name, sync_group_name, custom_headers)
  first_page.get_all_items
end

#list_hub_schemas_as_lazy(resource_group_name, server_name, database_name, sync_group_name, custom_headers = nil) ⇒ SyncFullSchemaPropertiesListResult

Gets a collection of hub database schemas.

contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. group is hosted. will be added to the HTTP request.

pages of the response.

Parameters:

  • resource_group_name (String)

    The name of the resource group that

  • server_name (String)

    The name of the server.

  • database_name (String)

    The name of the database on which the sync

  • sync_group_name (String)

    The name of the sync group.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (SyncFullSchemaPropertiesListResult)

    which provide lazy access to



1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
# File 'lib/2015-05-01-preview/generated/azure_mgmt_sql/sync_groups.rb', line 1793

def list_hub_schemas_as_lazy(resource_group_name, server_name, database_name, sync_group_name, custom_headers = nil)
  response = list_hub_schemas_async(resource_group_name, server_name, database_name, sync_group_name, custom_headers).value!
  unless response.nil?
    page = response.body
    page.next_method = Proc.new do |next_page_link|
      list_hub_schemas_next_async(next_page_link, custom_headers)
    end
    page
  end
end

#list_hub_schemas_async(resource_group_name, server_name, database_name, sync_group_name, custom_headers = nil) ⇒ Concurrent::Promise

Gets a collection of hub database schemas.

contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. group is hosted. to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group that

  • server_name (String)

    The name of the server.

  • database_name (String)

    The name of the database on which the sync

  • sync_group_name (String)

    The name of the sync group.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
# File 'lib/2015-05-01-preview/generated/azure_mgmt_sql/sync_groups.rb', line 219

def list_hub_schemas_async(resource_group_name, server_name, database_name, sync_group_name, custom_headers = nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, 'server_name is nil' if server_name.nil?
  fail ArgumentError, 'database_name is nil' if database_name.nil?
  fail ArgumentError, 'sync_group_name is nil' if sync_group_name.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?


  request_headers = {}

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/hubSchemas'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'resourceGroupName' => resource_group_name,'serverName' => server_name,'databaseName' => database_name,'syncGroupName' => sync_group_name,'subscriptionId' => @client.subscription_id},
      query_params: {'api-version' => @client.api_version},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:get, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::SQL::Mgmt::V2015_05_01_preview::Models::SyncFullSchemaPropertiesListResult.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#list_hub_schemas_next(next_page_link, custom_headers = nil) ⇒ SyncFullSchemaPropertiesListResult

Gets a collection of hub database schemas.

to List operation. will be added to the HTTP request.

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (SyncFullSchemaPropertiesListResult)

    operation results.



1504
1505
1506
1507
# File 'lib/2015-05-01-preview/generated/azure_mgmt_sql/sync_groups.rb', line 1504

def list_hub_schemas_next(next_page_link, custom_headers = nil)
  response = list_hub_schemas_next_async(next_page_link, custom_headers).value!
  response.body unless response.nil?
end

#list_hub_schemas_next_async(next_page_link, custom_headers = nil) ⇒ Concurrent::Promise

Gets a collection of hub database schemas.

to List operation. to the HTTP request.

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
# File 'lib/2015-05-01-preview/generated/azure_mgmt_sql/sync_groups.rb', line 1533

def list_hub_schemas_next_async(next_page_link, custom_headers = nil)
  fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?


  request_headers = {}

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = '{nextLink}'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      skip_encoding_path_params: {'nextLink' => next_page_link},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:get, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::SQL::Mgmt::V2015_05_01_preview::Models::SyncFullSchemaPropertiesListResult.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#list_hub_schemas_next_with_http_info(next_page_link, custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse

Gets a collection of hub database schemas.

to List operation. will be added to the HTTP request.

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



1519
1520
1521
# File 'lib/2015-05-01-preview/generated/azure_mgmt_sql/sync_groups.rb', line 1519

def list_hub_schemas_next_with_http_info(next_page_link, custom_headers = nil)
  list_hub_schemas_next_async(next_page_link, custom_headers).value!
end

#list_hub_schemas_with_http_info(resource_group_name, server_name, database_name, sync_group_name, custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse

Gets a collection of hub database schemas.

contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. group is hosted. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group that

  • server_name (String)

    The name of the server.

  • database_name (String)

    The name of the database on which the sync

  • sync_group_name (String)

    The name of the sync group.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



200
201
202
# File 'lib/2015-05-01-preview/generated/azure_mgmt_sql/sync_groups.rb', line 200

def list_hub_schemas_with_http_info(resource_group_name, server_name, database_name, sync_group_name, custom_headers = nil)
  list_hub_schemas_async(resource_group_name, server_name, database_name, sync_group_name, custom_headers).value!
end

#list_logs(resource_group_name, server_name, database_name, sync_group_name, start_time, end_time, type, continuation_token = nil, custom_headers = nil) ⇒ Array<SyncGroupLogProperties>

Gets a collection of sync group logs.

contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. group is hosted. ‘All’, ‘Error’, ‘Warning’, ‘Success’ will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group that

  • server_name (String)

    The name of the server.

  • database_name (String)

    The name of the database on which the sync

  • sync_group_name (String)

    The name of the sync group.

  • start_time (String)

    Get logs generated after this time.

  • end_time (String)

    Get logs generated before this time.

  • type (Enum)

    The types of logs to retrieve. Possible values include:

  • continuation_token (String) (defaults to: nil)

    The continuation token for this operation.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (Array<SyncGroupLogProperties>)

    operation results.



293
294
295
296
# File 'lib/2015-05-01-preview/generated/azure_mgmt_sql/sync_groups.rb', line 293

def list_logs(resource_group_name, server_name, database_name, sync_group_name, start_time, end_time, type, continuation_token = nil, custom_headers = nil)
  first_page = list_logs_as_lazy(resource_group_name, server_name, database_name, sync_group_name, start_time, end_time, type, continuation_token, custom_headers)
  first_page.get_all_items
end

#list_logs_as_lazy(resource_group_name, server_name, database_name, sync_group_name, start_time, end_time, type, continuation_token = nil, custom_headers = nil) ⇒ SyncGroupLogListResult

Gets a collection of sync group logs.

contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. group is hosted. ‘All’, ‘Error’, ‘Warning’, ‘Success’ will be added to the HTTP request.

response.

Parameters:

  • resource_group_name (String)

    The name of the resource group that

  • server_name (String)

    The name of the server.

  • database_name (String)

    The name of the database on which the sync

  • sync_group_name (String)

    The name of the sync group.

  • start_time (String)

    Get logs generated after this time.

  • end_time (String)

    Get logs generated before this time.

  • type (Enum)

    The types of logs to retrieve. Possible values include:

  • continuation_token (String) (defaults to: nil)

    The continuation token for this operation.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (SyncGroupLogListResult)

    which provide lazy access to pages of the



1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
# File 'lib/2015-05-01-preview/generated/azure_mgmt_sql/sync_groups.rb', line 1825

def list_logs_as_lazy(resource_group_name, server_name, database_name, sync_group_name, start_time, end_time, type, continuation_token = nil, custom_headers = nil)
  response = list_logs_async(resource_group_name, server_name, database_name, sync_group_name, start_time, end_time, type, continuation_token, custom_headers).value!
  unless response.nil?
    page = response.body
    page.next_method = Proc.new do |next_page_link|
      list_logs_next_async(next_page_link, custom_headers)
    end
    page
  end
end

#list_logs_async(resource_group_name, server_name, database_name, sync_group_name, start_time, end_time, type, continuation_token = nil, custom_headers = nil) ⇒ Concurrent::Promise

Gets a collection of sync group logs.

contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. group is hosted. ‘All’, ‘Error’, ‘Warning’, ‘Success’ to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group that

  • server_name (String)

    The name of the server.

  • database_name (String)

    The name of the database on which the sync

  • sync_group_name (String)

    The name of the sync group.

  • start_time (String)

    Get logs generated after this time.

  • end_time (String)

    Get logs generated before this time.

  • type (Enum)

    The types of logs to retrieve. Possible values include:

  • continuation_token (String) (defaults to: nil)

    The continuation token for this operation.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
# File 'lib/2015-05-01-preview/generated/azure_mgmt_sql/sync_groups.rb', line 342

def list_logs_async(resource_group_name, server_name, database_name, sync_group_name, start_time, end_time, type, continuation_token = nil, custom_headers = nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, 'server_name is nil' if server_name.nil?
  fail ArgumentError, 'database_name is nil' if database_name.nil?
  fail ArgumentError, 'sync_group_name is nil' if sync_group_name.nil?
  fail ArgumentError, 'start_time is nil' if start_time.nil?
  fail ArgumentError, 'end_time is nil' if end_time.nil?
  fail ArgumentError, 'type is nil' if type.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?


  request_headers = {}

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/logs'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'resourceGroupName' => resource_group_name,'serverName' => server_name,'databaseName' => database_name,'syncGroupName' => sync_group_name,'subscriptionId' => @client.subscription_id},
      query_params: {'startTime' => start_time,'endTime' => end_time,'type' => type,'continuationToken' => continuation_token,'api-version' => @client.api_version},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:get, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::SQL::Mgmt::V2015_05_01_preview::Models::SyncGroupLogListResult.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#list_logs_next(next_page_link, custom_headers = nil) ⇒ SyncGroupLogListResult

Gets a collection of sync group logs.

to List operation. will be added to the HTTP request.

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (SyncGroupLogListResult)

    operation results.



1591
1592
1593
1594
# File 'lib/2015-05-01-preview/generated/azure_mgmt_sql/sync_groups.rb', line 1591

def list_logs_next(next_page_link, custom_headers = nil)
  response = list_logs_next_async(next_page_link, custom_headers).value!
  response.body unless response.nil?
end

#list_logs_next_async(next_page_link, custom_headers = nil) ⇒ Concurrent::Promise

Gets a collection of sync group logs.

to List operation. to the HTTP request.

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
# File 'lib/2015-05-01-preview/generated/azure_mgmt_sql/sync_groups.rb', line 1620

def list_logs_next_async(next_page_link, custom_headers = nil)
  fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?


  request_headers = {}

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = '{nextLink}'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      skip_encoding_path_params: {'nextLink' => next_page_link},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:get, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::SQL::Mgmt::V2015_05_01_preview::Models::SyncGroupLogListResult.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#list_logs_next_with_http_info(next_page_link, custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse

Gets a collection of sync group logs.

to List operation. will be added to the HTTP request.

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



1606
1607
1608
# File 'lib/2015-05-01-preview/generated/azure_mgmt_sql/sync_groups.rb', line 1606

def list_logs_next_with_http_info(next_page_link, custom_headers = nil)
  list_logs_next_async(next_page_link, custom_headers).value!
end

#list_logs_with_http_info(resource_group_name, server_name, database_name, sync_group_name, start_time, end_time, type, continuation_token = nil, custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse

Gets a collection of sync group logs.

contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. group is hosted. ‘All’, ‘Error’, ‘Warning’, ‘Success’ will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group that

  • server_name (String)

    The name of the server.

  • database_name (String)

    The name of the database on which the sync

  • sync_group_name (String)

    The name of the sync group.

  • start_time (String)

    Get logs generated after this time.

  • end_time (String)

    Get logs generated before this time.

  • type (Enum)

    The types of logs to retrieve. Possible values include:

  • continuation_token (String) (defaults to: nil)

    The continuation token for this operation.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



318
319
320
# File 'lib/2015-05-01-preview/generated/azure_mgmt_sql/sync_groups.rb', line 318

def list_logs_with_http_info(resource_group_name, server_name, database_name, sync_group_name, start_time, end_time, type, continuation_token = nil, custom_headers = nil)
  list_logs_async(resource_group_name, server_name, database_name, sync_group_name, start_time, end_time, type, continuation_token, custom_headers).value!
end

#list_sync_database_ids(location_name, custom_headers = nil) ⇒ Array<SyncDatabaseIdProperties>

Gets a collection of sync database ids.

located. will be added to the HTTP request.

Parameters:

  • location_name (String)

    The name of the region where the resource is

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (Array<SyncDatabaseIdProperties>)

    operation results.



37
38
39
40
# File 'lib/2015-05-01-preview/generated/azure_mgmt_sql/sync_groups.rb', line 37

def list_sync_database_ids(location_name, custom_headers = nil)
  first_page = list_sync_database_ids_as_lazy(location_name, custom_headers)
  first_page.get_all_items
end

#list_sync_database_ids_as_lazy(location_name, custom_headers = nil) ⇒ SyncDatabaseIdListResult

Gets a collection of sync database ids.

located. will be added to the HTTP request.

response.

Parameters:

  • location_name (String)

    The name of the region where the resource is

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (SyncDatabaseIdListResult)

    which provide lazy access to pages of the



1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
# File 'lib/2015-05-01-preview/generated/azure_mgmt_sql/sync_groups.rb', line 1766

def list_sync_database_ids_as_lazy(location_name, custom_headers = nil)
  response = list_sync_database_ids_async(location_name, custom_headers).value!
  unless response.nil?
    page = response.body
    page.next_method = Proc.new do |next_page_link|
      list_sync_database_ids_next_async(next_page_link, custom_headers)
    end
    page
  end
end

#list_sync_database_ids_async(location_name, custom_headers = nil) ⇒ Concurrent::Promise

Gets a collection of sync database ids.

located. to the HTTP request.

Parameters:

  • location_name (String)

    The name of the region where the resource is

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
# File 'lib/2015-05-01-preview/generated/azure_mgmt_sql/sync_groups.rb', line 66

def list_sync_database_ids_async(location_name, custom_headers = nil)
  fail ArgumentError, 'location_name is nil' if location_name.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?


  request_headers = {}

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/syncDatabaseIds'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'locationName' => location_name,'subscriptionId' => @client.subscription_id},
      query_params: {'api-version' => @client.api_version},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:get, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::SQL::Mgmt::V2015_05_01_preview::Models::SyncDatabaseIdListResult.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#list_sync_database_ids_next(next_page_link, custom_headers = nil) ⇒ SyncDatabaseIdListResult

Gets a collection of sync database ids.

to List operation. will be added to the HTTP request.

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (SyncDatabaseIdListResult)

    operation results.



1417
1418
1419
1420
# File 'lib/2015-05-01-preview/generated/azure_mgmt_sql/sync_groups.rb', line 1417

def list_sync_database_ids_next(next_page_link, custom_headers = nil)
  response = list_sync_database_ids_next_async(next_page_link, custom_headers).value!
  response.body unless response.nil?
end

#list_sync_database_ids_next_async(next_page_link, custom_headers = nil) ⇒ Concurrent::Promise

Gets a collection of sync database ids.

to List operation. to the HTTP request.

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
# File 'lib/2015-05-01-preview/generated/azure_mgmt_sql/sync_groups.rb', line 1446

def list_sync_database_ids_next_async(next_page_link, custom_headers = nil)
  fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?


  request_headers = {}

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = '{nextLink}'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      skip_encoding_path_params: {'nextLink' => next_page_link},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:get, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::SQL::Mgmt::V2015_05_01_preview::Models::SyncDatabaseIdListResult.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#list_sync_database_ids_next_with_http_info(next_page_link, custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse

Gets a collection of sync database ids.

to List operation. will be added to the HTTP request.

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



1432
1433
1434
# File 'lib/2015-05-01-preview/generated/azure_mgmt_sql/sync_groups.rb', line 1432

def list_sync_database_ids_next_with_http_info(next_page_link, custom_headers = nil)
  list_sync_database_ids_next_async(next_page_link, custom_headers).value!
end

#list_sync_database_ids_with_http_info(location_name, custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse

Gets a collection of sync database ids.

located. will be added to the HTTP request.

Parameters:

  • location_name (String)

    The name of the region where the resource is

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



52
53
54
# File 'lib/2015-05-01-preview/generated/azure_mgmt_sql/sync_groups.rb', line 52

def list_sync_database_ids_with_http_info(location_name, custom_headers = nil)
  list_sync_database_ids_async(location_name, custom_headers).value!
end

#refresh_hub_schema(resource_group_name, server_name, database_name, sync_group_name, custom_headers = nil) ⇒ Object

Refreshes a hub database schema.

contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. group is hosted. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group that

  • server_name (String)

    The name of the server.

  • database_name (String)

    The name of the database on which the sync

  • sync_group_name (String)

    The name of the sync group.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that



130
131
132
133
# File 'lib/2015-05-01-preview/generated/azure_mgmt_sql/sync_groups.rb', line 130

def refresh_hub_schema(resource_group_name, server_name, database_name, sync_group_name, custom_headers = nil)
  response = refresh_hub_schema_async(resource_group_name, server_name, database_name, sync_group_name, custom_headers).value!
  nil
end

#refresh_hub_schema_async(resource_group_name, server_name, database_name, sync_group_name, custom_headers = nil) ⇒ Concurrent::Promise

contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. group is hosted. will be added to the HTTP request.

response.

Parameters:

  • resource_group_name (String)

    The name of the resource group that

  • server_name (String)

    The name of the server.

  • database_name (String)

    The name of the database on which the sync

  • sync_group_name (String)

    The name of the sync group.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (Concurrent::Promise)

    promise which provides async access to http



149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
# File 'lib/2015-05-01-preview/generated/azure_mgmt_sql/sync_groups.rb', line 149

def refresh_hub_schema_async(resource_group_name, server_name, database_name, sync_group_name, custom_headers = nil)
  # Send request
  promise = begin_refresh_hub_schema_async(resource_group_name, server_name, database_name, sync_group_name, custom_headers)

  promise = promise.then do |response|
    # Defining deserialization method.
    deserialize_method = lambda do |parsed_response|
    end

    # Waiting for response.
    @client.get_long_running_operation_result(response, deserialize_method)
  end

  promise
end

#trigger_sync(resource_group_name, server_name, database_name, sync_group_name, custom_headers = nil) ⇒ Object

Triggers a sync group synchronization.

contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. group is hosted. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group that

  • server_name (String)

    The name of the server.

  • database_name (String)

    The name of the database on which the sync

  • sync_group_name (String)

    The name of the sync group.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that



510
511
512
513
# File 'lib/2015-05-01-preview/generated/azure_mgmt_sql/sync_groups.rb', line 510

def trigger_sync(resource_group_name, server_name, database_name, sync_group_name, custom_headers = nil)
  response = trigger_sync_async(resource_group_name, server_name, database_name, sync_group_name, custom_headers).value!
  nil
end

#trigger_sync_async(resource_group_name, server_name, database_name, sync_group_name, custom_headers = nil) ⇒ Concurrent::Promise

Triggers a sync group synchronization.

contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. group is hosted. to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group that

  • server_name (String)

    The name of the server.

  • database_name (String)

    The name of the database on which the sync

  • sync_group_name (String)

    The name of the sync group.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
# File 'lib/2015-05-01-preview/generated/azure_mgmt_sql/sync_groups.rb', line 549

def trigger_sync_async(resource_group_name, server_name, database_name, sync_group_name, custom_headers = nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, 'server_name is nil' if server_name.nil?
  fail ArgumentError, 'database_name is nil' if database_name.nil?
  fail ArgumentError, 'sync_group_name is nil' if sync_group_name.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?


  request_headers = {}

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/triggerSync'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'resourceGroupName' => resource_group_name,'serverName' => server_name,'databaseName' => database_name,'syncGroupName' => sync_group_name,'subscriptionId' => @client.subscription_id},
      query_params: {'api-version' => @client.api_version},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:post, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?

    result
  end

  promise.execute
end

#trigger_sync_with_http_info(resource_group_name, server_name, database_name, sync_group_name, custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse

Triggers a sync group synchronization.

contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. group is hosted. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group that

  • server_name (String)

    The name of the server.

  • database_name (String)

    The name of the database on which the sync

  • sync_group_name (String)

    The name of the sync group.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



530
531
532
# File 'lib/2015-05-01-preview/generated/azure_mgmt_sql/sync_groups.rb', line 530

def trigger_sync_with_http_info(resource_group_name, server_name, database_name, sync_group_name, custom_headers = nil)
  trigger_sync_async(resource_group_name, server_name, database_name, sync_group_name, custom_headers).value!
end

#update(resource_group_name, server_name, database_name, sync_group_name, parameters, custom_headers = nil) ⇒ SyncGroup

Updates a sync group.

contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. group is hosted. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group that

  • server_name (String)

    The name of the server.

  • database_name (String)

    The name of the database on which the sync

  • sync_group_name (String)

    The name of the sync group.

  • parameters (SyncGroup)

    The requested sync group resource state.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (SyncGroup)

    operation results.



819
820
821
822
# File 'lib/2015-05-01-preview/generated/azure_mgmt_sql/sync_groups.rb', line 819

def update(resource_group_name, server_name, database_name, sync_group_name, parameters, custom_headers = nil)
  response = update_async(resource_group_name, server_name, database_name, sync_group_name, parameters, custom_headers).value!
  response.body unless response.nil?
end

#update_async(resource_group_name, server_name, database_name, sync_group_name, parameters, custom_headers = nil) ⇒ Concurrent::Promise

contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. group is hosted. will be added to the HTTP request.

response.

Parameters:

  • resource_group_name (String)

    The name of the resource group that

  • server_name (String)

    The name of the server.

  • database_name (String)

    The name of the database on which the sync

  • sync_group_name (String)

    The name of the sync group.

  • parameters (SyncGroup)

    The requested sync group resource state.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (Concurrent::Promise)

    promise which provides async access to http



839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
# File 'lib/2015-05-01-preview/generated/azure_mgmt_sql/sync_groups.rb', line 839

def update_async(resource_group_name, server_name, database_name, sync_group_name, parameters, custom_headers = nil)
  # Send request
  promise = begin_update_async(resource_group_name, server_name, database_name, sync_group_name, parameters, custom_headers)

  promise = promise.then do |response|
    # Defining deserialization method.
    deserialize_method = lambda do |parsed_response|
      result_mapper = Azure::SQL::Mgmt::V2015_05_01_preview::Models::SyncGroup.mapper()
      parsed_response = @client.deserialize(result_mapper, parsed_response)
    end

    # Waiting for response.
    @client.get_long_running_operation_result(response, deserialize_method)
  end

  promise
end