Class: Azure::ServerManagement::Mgmt::V2016_07_01_preview::Gateway

Inherits:
Object
  • Object
show all
Includes:
MsRestAzure
Defined in:
lib/2016-07-01-preview/generated/azure_mgmt_server_management/gateway.rb

Overview

REST API for Azure Server Management Service.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ Gateway

Creates and initializes a new instance of the Gateway class.

Parameters:

  • client

    service class for accessing basic functionality.



17
18
19
# File 'lib/2016-07-01-preview/generated/azure_mgmt_server_management/gateway.rb', line 17

def initialize(client)
  @client = client
end

Instance Attribute Details

#clientServerManagement (readonly)

Returns reference to the ServerManagement.

Returns:



22
23
24
# File 'lib/2016-07-01-preview/generated/azure_mgmt_server_management/gateway.rb', line 22

def client
  @client
end

Instance Method Details

#begin_create(resource_group_name, gateway_name, location = nil, tags = nil, upgrade_mode = nil, custom_headers = nil) ⇒ GatewayResource

Creates or updates a ManagementService gateway.

identifies the resource group within the user subscriptionId. flexibility to gateway to auto upgrade itself. If properties value not specified, then we assume upgradeMode = Automatic. Possible values include: ‘Manual’, ‘Automatic’ will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The resource group name uniquely

  • gateway_name (String)

    The gateway name (256 characters maximum).

  • location (String) (defaults to: nil)

    Location of the resource.

  • tags (defaults to: nil)

    Resource tags.

  • upgrade_mode (UpgradeMode) (defaults to: nil)

    The upgradeMode property gives the

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

    A hash of custom headers that

Returns:

  • (GatewayResource)

    operation results.



639
640
641
642
# File 'lib/2016-07-01-preview/generated/azure_mgmt_server_management/gateway.rb', line 639

def begin_create(resource_group_name, gateway_name, location = nil, tags = nil, upgrade_mode = nil, custom_headers = nil)
  response = begin_create_async(resource_group_name, gateway_name, location, tags, upgrade_mode, custom_headers).value!
  response.body unless response.nil?
end

#begin_create_async(resource_group_name, gateway_name, location = nil, tags = nil, upgrade_mode = nil, custom_headers = nil) ⇒ Concurrent::Promise

Creates or updates a ManagementService gateway.

identifies the resource group within the user subscriptionId. flexibility to gateway to auto upgrade itself. If properties value not specified, then we assume upgradeMode = Automatic. Possible values include: ‘Manual’, ‘Automatic’ to the HTTP request.

Parameters:

  • resource_group_name (String)

    The resource group name uniquely

  • gateway_name (String)

    The gateway name (256 characters maximum).

  • location (String) (defaults to: nil)

    Location of the resource.

  • tags (defaults to: nil)

    Resource tags.

  • upgrade_mode (UpgradeMode) (defaults to: nil)

    The upgradeMode property gives the

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
# File 'lib/2016-07-01-preview/generated/azure_mgmt_server_management/gateway.rb', line 682

def begin_create_async(resource_group_name, gateway_name, location = nil, tags = nil, upgrade_mode = nil, custom_headers = 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?
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, 'gateway_name is nil' if gateway_name.nil?

  gateway_parameters = GatewayParameters.new
  unless location.nil? && tags.nil? && upgrade_mode.nil?
    gateway_parameters.location = location
    gateway_parameters.tags = tags
    gateway_parameters.upgrade_mode = upgrade_mode
  end

  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::ServerManagement::Mgmt::V2016_07_01_preview::Models::GatewayParameters.mapper()
  request_content = @client.serialize(request_mapper,  gateway_parameters)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServerManagement/gateways/{gatewayName}'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'gatewayName' => gateway_name},
      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 == 201
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.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::ServerManagement::Mgmt::V2016_07_01_preview::Models::GatewayResource.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::ServerManagement::Mgmt::V2016_07_01_preview::Models::GatewayResource.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_with_http_info(resource_group_name, gateway_name, location = nil, tags = nil, upgrade_mode = nil, custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse

Creates or updates a ManagementService gateway.

identifies the resource group within the user subscriptionId. flexibility to gateway to auto upgrade itself. If properties value not specified, then we assume upgradeMode = Automatic. Possible values include: ‘Manual’, ‘Automatic’ will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The resource group name uniquely

  • gateway_name (String)

    The gateway name (256 characters maximum).

  • location (String) (defaults to: nil)

    Location of the resource.

  • tags (defaults to: nil)

    Resource tags.

  • upgrade_mode (UpgradeMode) (defaults to: nil)

    The upgradeMode property gives the

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



661
662
663
# File 'lib/2016-07-01-preview/generated/azure_mgmt_server_management/gateway.rb', line 661

def begin_create_with_http_info(resource_group_name, gateway_name, location = nil, tags = nil, upgrade_mode = nil, custom_headers = nil)
  begin_create_async(resource_group_name, gateway_name, location, tags, upgrade_mode, custom_headers).value!
end

#begin_get_profile(resource_group_name, gateway_name, custom_headers = nil) ⇒ GatewayProfile

Gets a gateway profile.

identifies the resource group within the user subscriptionId. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The resource group name uniquely

  • gateway_name (String)

    The gateway name (256 characters maximum).

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

    A hash of custom headers that

Returns:

  • (GatewayProfile)

    operation results.



1063
1064
1065
1066
# File 'lib/2016-07-01-preview/generated/azure_mgmt_server_management/gateway.rb', line 1063

def begin_get_profile(resource_group_name, gateway_name, custom_headers = nil)
  response = begin_get_profile_async(resource_group_name, gateway_name, custom_headers).value!
  response.body unless response.nil?
end

#begin_get_profile_async(resource_group_name, gateway_name, custom_headers = nil) ⇒ Concurrent::Promise

Gets a gateway profile.

identifies the resource group within the user subscriptionId. to the HTTP request.

Parameters:

  • resource_group_name (String)

    The resource group name uniquely

  • gateway_name (String)

    The gateway name (256 characters maximum).

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
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
# File 'lib/2016-07-01-preview/generated/azure_mgmt_server_management/gateway.rb', line 1094

def begin_get_profile_async(resource_group_name, gateway_name, custom_headers = 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?
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, 'gateway_name is nil' if gateway_name.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.ServerManagement/gateways/{gatewayName}/profile'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'gatewayName' => gateway_name},
      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 MsRest::HttpOperationError.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::ServerManagement::Mgmt::V2016_07_01_preview::Models::GatewayProfile.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_get_profile_with_http_info(resource_group_name, gateway_name, custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse

Gets a gateway profile.

identifies the resource group within the user subscriptionId. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The resource group name uniquely

  • gateway_name (String)

    The gateway name (256 characters maximum).

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



1079
1080
1081
# File 'lib/2016-07-01-preview/generated/azure_mgmt_server_management/gateway.rb', line 1079

def begin_get_profile_with_http_info(resource_group_name, gateway_name, custom_headers = nil)
  begin_get_profile_async(resource_group_name, gateway_name, custom_headers).value!
end

#begin_regenerate_profile(resource_group_name, gateway_name, custom_headers = nil) ⇒ Object

Regenerate a gateway’s profile

identifies the resource group within the user subscriptionId. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The resource group name uniquely

  • gateway_name (String)

    The gateway name (256 characters maximum).

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

    A hash of custom headers that



979
980
981
982
# File 'lib/2016-07-01-preview/generated/azure_mgmt_server_management/gateway.rb', line 979

def begin_regenerate_profile(resource_group_name, gateway_name, custom_headers = nil)
  response = begin_regenerate_profile_async(resource_group_name, gateway_name, custom_headers).value!
  nil
end

#begin_regenerate_profile_async(resource_group_name, gateway_name, custom_headers = nil) ⇒ Concurrent::Promise

Regenerate a gateway’s profile

identifies the resource group within the user subscriptionId. to the HTTP request.

Parameters:

  • resource_group_name (String)

    The resource group name uniquely

  • gateway_name (String)

    The gateway name (256 characters maximum).

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



1010
1011
1012
1013
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
# File 'lib/2016-07-01-preview/generated/azure_mgmt_server_management/gateway.rb', line 1010

def begin_regenerate_profile_async(resource_group_name, gateway_name, custom_headers = 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?
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, 'gateway_name is nil' if gateway_name.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.ServerManagement/gateways/{gatewayName}/regenerateprofile'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'gatewayName' => gateway_name},
      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 MsRest::HttpOperationError.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_regenerate_profile_with_http_info(resource_group_name, gateway_name, custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse

Regenerate a gateway’s profile

identifies the resource group within the user subscriptionId. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The resource group name uniquely

  • gateway_name (String)

    The gateway name (256 characters maximum).

  • 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/2016-07-01-preview/generated/azure_mgmt_server_management/gateway.rb', line 995

def begin_regenerate_profile_with_http_info(resource_group_name, gateway_name, custom_headers = nil)
  begin_regenerate_profile_async(resource_group_name, gateway_name, custom_headers).value!
end

#begin_update(resource_group_name, gateway_name, location = nil, tags = nil, upgrade_mode = nil, custom_headers = nil) ⇒ GatewayResource

Updates a gateway belonging to a resource group.

identifies the resource group within the user subscriptionId. flexibility to gateway to auto upgrade itself. If properties value not specified, then we assume upgradeMode = Automatic. Possible values include: ‘Manual’, ‘Automatic’ will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The resource group name uniquely

  • gateway_name (String)

    The gateway name (256 characters maximum).

  • location (String) (defaults to: nil)

    Location of the resource.

  • tags (defaults to: nil)

    Resource tags.

  • upgrade_mode (UpgradeMode) (defaults to: nil)

    The upgradeMode property gives the

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

    A hash of custom headers that

Returns:

  • (GatewayResource)

    operation results.



776
777
778
779
# File 'lib/2016-07-01-preview/generated/azure_mgmt_server_management/gateway.rb', line 776

def begin_update(resource_group_name, gateway_name, location = nil, tags = nil, upgrade_mode = nil, custom_headers = nil)
  response = begin_update_async(resource_group_name, gateway_name, location, tags, upgrade_mode, custom_headers).value!
  response.body unless response.nil?
end

#begin_update_async(resource_group_name, gateway_name, location = nil, tags = nil, upgrade_mode = nil, custom_headers = nil) ⇒ Concurrent::Promise

Updates a gateway belonging to a resource group.

identifies the resource group within the user subscriptionId. flexibility to gateway to auto upgrade itself. If properties value not specified, then we assume upgradeMode = Automatic. Possible values include: ‘Manual’, ‘Automatic’ to the HTTP request.

Parameters:

  • resource_group_name (String)

    The resource group name uniquely

  • gateway_name (String)

    The gateway name (256 characters maximum).

  • location (String) (defaults to: nil)

    Location of the resource.

  • tags (defaults to: nil)

    Resource tags.

  • upgrade_mode (UpgradeMode) (defaults to: nil)

    The upgradeMode property gives the

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
# File 'lib/2016-07-01-preview/generated/azure_mgmt_server_management/gateway.rb', line 819

def begin_update_async(resource_group_name, gateway_name, location = nil, tags = nil, upgrade_mode = nil, custom_headers = 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?
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, 'gateway_name is nil' if gateway_name.nil?

  gateway_parameters = GatewayParameters.new
  unless location.nil? && tags.nil? && upgrade_mode.nil?
    gateway_parameters.location = location
    gateway_parameters.tags = tags
    gateway_parameters.upgrade_mode = upgrade_mode
  end

  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::ServerManagement::Mgmt::V2016_07_01_preview::Models::GatewayParameters.mapper()
  request_content = @client.serialize(request_mapper,  gateway_parameters)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServerManagement/gateways/{gatewayName}'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'gatewayName' => gateway_name},
      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 MsRest::HttpOperationError.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::ServerManagement::Mgmt::V2016_07_01_preview::Models::GatewayResource.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, gateway_name, location = nil, tags = nil, upgrade_mode = nil, custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse

Updates a gateway belonging to a resource group.

identifies the resource group within the user subscriptionId. flexibility to gateway to auto upgrade itself. If properties value not specified, then we assume upgradeMode = Automatic. Possible values include: ‘Manual’, ‘Automatic’ will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The resource group name uniquely

  • gateway_name (String)

    The gateway name (256 characters maximum).

  • location (String) (defaults to: nil)

    Location of the resource.

  • tags (defaults to: nil)

    Resource tags.

  • upgrade_mode (UpgradeMode) (defaults to: nil)

    The upgradeMode property gives the

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



798
799
800
# File 'lib/2016-07-01-preview/generated/azure_mgmt_server_management/gateway.rb', line 798

def begin_update_with_http_info(resource_group_name, gateway_name, location = nil, tags = nil, upgrade_mode = nil, custom_headers = nil)
  begin_update_async(resource_group_name, gateway_name, location, tags, upgrade_mode, custom_headers).value!
end

#begin_upgrade(resource_group_name, gateway_name, custom_headers = nil) ⇒ Object

Upgrades a gateway.

identifies the resource group within the user subscriptionId. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The resource group name uniquely

  • gateway_name (String)

    The gateway name (256 characters maximum).

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

    A hash of custom headers that



896
897
898
899
# File 'lib/2016-07-01-preview/generated/azure_mgmt_server_management/gateway.rb', line 896

def begin_upgrade(resource_group_name, gateway_name, custom_headers = nil)
  response = begin_upgrade_async(resource_group_name, gateway_name, custom_headers).value!
  nil
end

#begin_upgrade_async(resource_group_name, gateway_name, custom_headers = nil) ⇒ Concurrent::Promise

Upgrades a gateway.

identifies the resource group within the user subscriptionId. to the HTTP request.

Parameters:

  • resource_group_name (String)

    The resource group name uniquely

  • gateway_name (String)

    The gateway name (256 characters maximum).

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



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
960
961
962
963
964
965
966
967
# File 'lib/2016-07-01-preview/generated/azure_mgmt_server_management/gateway.rb', line 927

def begin_upgrade_async(resource_group_name, gateway_name, custom_headers = 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?
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, 'gateway_name is nil' if gateway_name.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.ServerManagement/gateways/{gatewayName}/upgradetolatest'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'gatewayName' => gateway_name},
      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 MsRest::HttpOperationError.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_upgrade_with_http_info(resource_group_name, gateway_name, custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse

Upgrades a gateway.

identifies the resource group within the user subscriptionId. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The resource group name uniquely

  • gateway_name (String)

    The gateway name (256 characters maximum).

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



912
913
914
# File 'lib/2016-07-01-preview/generated/azure_mgmt_server_management/gateway.rb', line 912

def begin_upgrade_with_http_info(resource_group_name, gateway_name, custom_headers = nil)
  begin_upgrade_async(resource_group_name, gateway_name, custom_headers).value!
end

#create(resource_group_name, gateway_name, location = nil, tags = nil, upgrade_mode = nil, custom_headers = nil) ⇒ GatewayResource

Creates or updates a ManagementService gateway.

identifies the resource group within the user subscriptionId. flexibility to gateway to auto upgrade itself. If properties value not specified, then we assume upgradeMode = Automatic. Possible values include: ‘Manual’, ‘Automatic’ will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The resource group name uniquely

  • gateway_name (String)

    The gateway name (256 characters maximum).

  • location (String) (defaults to: nil)

    Location of the resource.

  • tags (defaults to: nil)

    Resource tags.

  • upgrade_mode (UpgradeMode) (defaults to: nil)

    The upgradeMode property gives the

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

    A hash of custom headers that

Returns:

  • (GatewayResource)

    operation results.



41
42
43
44
# File 'lib/2016-07-01-preview/generated/azure_mgmt_server_management/gateway.rb', line 41

def create(resource_group_name, gateway_name, location = nil, tags = nil, upgrade_mode = nil, custom_headers = nil)
  response = create_async(resource_group_name, gateway_name, location, tags, upgrade_mode, custom_headers).value!
  response.body unless response.nil?
end

#create_async(resource_group_name, gateway_name, location = nil, tags = nil, upgrade_mode = nil, custom_headers = nil) ⇒ Concurrent::Promise

identifies the resource group within the user subscriptionId. flexibility to gateway to auto upgrade itself. If properties value not specified, then we assume upgradeMode = Automatic. Possible values include: ‘Manual’, ‘Automatic’ will be added to the HTTP request.

response.

Parameters:

  • resource_group_name (String)

    The resource group name uniquely

  • gateway_name (String)

    The gateway name (256 characters maximum).

  • location (String) (defaults to: nil)

    Location of the resource.

  • tags (defaults to: nil)

    Resource tags.

  • upgrade_mode (UpgradeMode) (defaults to: nil)

    The upgradeMode property gives the

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

    A hash of custom headers that

Returns:

  • (Concurrent::Promise)

    promise which provides async access to http



62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
# File 'lib/2016-07-01-preview/generated/azure_mgmt_server_management/gateway.rb', line 62

def create_async(resource_group_name, gateway_name, location = nil, tags = nil, upgrade_mode = nil, custom_headers = nil)
  # Send request
  promise = begin_create_async(resource_group_name, gateway_name, location, tags, upgrade_mode, custom_headers)

  promise = promise.then do |response|
    # Defining deserialization method.
    deserialize_method = lambda do |parsed_response|
      result_mapper = Azure::ServerManagement::Mgmt::V2016_07_01_preview::Models::GatewayResource.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, gateway_name, custom_headers = nil) ⇒ Object

Deletes a gateway from a resource group.

identifies the resource group within the user subscriptionId. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The resource group name uniquely

  • gateway_name (String)

    The gateway name (256 characters maximum).

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

    A hash of custom headers that



146
147
148
149
# File 'lib/2016-07-01-preview/generated/azure_mgmt_server_management/gateway.rb', line 146

def delete(resource_group_name, gateway_name, custom_headers = nil)
  response = delete_async(resource_group_name, gateway_name, custom_headers).value!
  nil
end

#delete_async(resource_group_name, gateway_name, custom_headers = nil) ⇒ Concurrent::Promise

Deletes a gateway from a resource group.

identifies the resource group within the user subscriptionId. to the HTTP request.

Parameters:

  • resource_group_name (String)

    The resource group name uniquely

  • gateway_name (String)

    The gateway name (256 characters maximum).

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
# File 'lib/2016-07-01-preview/generated/azure_mgmt_server_management/gateway.rb', line 177

def delete_async(resource_group_name, gateway_name, custom_headers = 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?
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, 'gateway_name is nil' if gateway_name.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.ServerManagement/gateways/{gatewayName}'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'gatewayName' => gateway_name},
      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 == 204
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.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

#delete_with_http_info(resource_group_name, gateway_name, custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse

Deletes a gateway from a resource group.

identifies the resource group within the user subscriptionId. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The resource group name uniquely

  • gateway_name (String)

    The gateway name (256 characters maximum).

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



162
163
164
# File 'lib/2016-07-01-preview/generated/azure_mgmt_server_management/gateway.rb', line 162

def delete_with_http_info(resource_group_name, gateway_name, custom_headers = nil)
  delete_async(resource_group_name, gateway_name, custom_headers).value!
end

#get(resource_group_name, gateway_name, expand = nil, custom_headers = nil) ⇒ GatewayResource

Gets a gateway.

identifies the resource group within the user subscriptionId. uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. Possible values include: ‘status’, ‘download’ will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The resource group name uniquely

  • gateway_name (String)

    The gateway name (256 characters maximum)

  • expand (GatewayExpandOption) (defaults to: nil)

    Gets subscription credentials which

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

    A hash of custom headers that

Returns:

  • (GatewayResource)

    operation results.



234
235
236
237
# File 'lib/2016-07-01-preview/generated/azure_mgmt_server_management/gateway.rb', line 234

def get(resource_group_name, gateway_name, expand = nil, custom_headers = nil)
  response = get_async(resource_group_name, gateway_name, expand, custom_headers).value!
  response.body unless response.nil?
end

#get_async(resource_group_name, gateway_name, expand = nil, custom_headers = nil) ⇒ Concurrent::Promise

Gets a gateway.

identifies the resource group within the user subscriptionId. uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. Possible values include: ‘status’, ‘download’ to the HTTP request.

Parameters:

  • resource_group_name (String)

    The resource group name uniquely

  • gateway_name (String)

    The gateway name (256 characters maximum)

  • expand (GatewayExpandOption) (defaults to: nil)

    Gets subscription credentials which

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
# File 'lib/2016-07-01-preview/generated/azure_mgmt_server_management/gateway.rb', line 273

def get_async(resource_group_name, gateway_name, expand = nil, custom_headers = 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?
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, 'gateway_name is nil' if gateway_name.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.ServerManagement/gateways/{gatewayName}'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'gatewayName' => gateway_name},
      query_params: {'api-version' => @client.api_version,'$expand' => expand},
      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 MsRest::HttpOperationError.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::ServerManagement::Mgmt::V2016_07_01_preview::Models::GatewayResource.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_profile(resource_group_name, gateway_name, custom_headers = nil) ⇒ GatewayProfile

Gets a gateway profile.

identifies the resource group within the user subscriptionId. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The resource group name uniquely

  • gateway_name (String)

    The gateway name (256 characters maximum).

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

    A hash of custom headers that

Returns:

  • (GatewayProfile)

    operation results.



589
590
591
592
# File 'lib/2016-07-01-preview/generated/azure_mgmt_server_management/gateway.rb', line 589

def get_profile(resource_group_name, gateway_name, custom_headers = nil)
  response = get_profile_async(resource_group_name, gateway_name, custom_headers).value!
  response.body unless response.nil?
end

#get_profile_async(resource_group_name, gateway_name, custom_headers = nil) ⇒ Concurrent::Promise

identifies the resource group within the user subscriptionId. will be added to the HTTP request.

response.

Parameters:

  • resource_group_name (String)

    The resource group name uniquely

  • gateway_name (String)

    The gateway name (256 characters maximum).

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

    A hash of custom headers that

Returns:

  • (Concurrent::Promise)

    promise which provides async access to http



604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
# File 'lib/2016-07-01-preview/generated/azure_mgmt_server_management/gateway.rb', line 604

def get_profile_async(resource_group_name, gateway_name, custom_headers = nil)
  # Send request
  promise = begin_get_profile_async(resource_group_name, gateway_name, custom_headers)

  promise = promise.then do |response|
    # Defining deserialization method.
    deserialize_method = lambda do |parsed_response|
      result_mapper = Azure::ServerManagement::Mgmt::V2016_07_01_preview::Models::GatewayProfile.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

#get_with_http_info(resource_group_name, gateway_name, expand = nil, custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse

Gets a gateway.

identifies the resource group within the user subscriptionId. uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. Possible values include: ‘status’, ‘download’ will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The resource group name uniquely

  • gateway_name (String)

    The gateway name (256 characters maximum)

  • expand (GatewayExpandOption) (defaults to: nil)

    Gets subscription credentials which

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



254
255
256
# File 'lib/2016-07-01-preview/generated/azure_mgmt_server_management/gateway.rb', line 254

def get_with_http_info(resource_group_name, gateway_name, expand = nil, custom_headers = nil)
  get_async(resource_group_name, gateway_name, expand, custom_headers).value!
end

#list(custom_headers = nil) ⇒ Array<GatewayResource>

Returns gateways in a subscription.

will be added to the HTTP request.

Parameters:

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

    A hash of custom headers that

Returns:

  • (Array<GatewayResource>)

    operation results.



333
334
335
336
# File 'lib/2016-07-01-preview/generated/azure_mgmt_server_management/gateway.rb', line 333

def list(custom_headers = nil)
  first_page = list_as_lazy(custom_headers)
  first_page.get_all_items
end

#list_as_lazy(custom_headers = nil) ⇒ GatewayResources

Returns gateways in a subscription.

will be added to the HTTP request.

response.

Parameters:

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

    A hash of custom headers that

Returns:

  • (GatewayResources)

    which provide lazy access to pages of the



1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
# File 'lib/2016-07-01-preview/generated/azure_mgmt_server_management/gateway.rb', line 1329

def list_as_lazy(custom_headers = nil)
  response = list_async(custom_headers).value!
  unless response.nil?
    page = response.body
    page.next_method = Proc.new do |next_page_link|
      list_next_async(next_page_link, custom_headers)
    end
    page
  end
end

#list_async(custom_headers = nil) ⇒ Concurrent::Promise

Returns gateways in a subscription.

to the HTTP request.

Parameters:

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



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
398
399
400
401
402
403
404
405
406
# File 'lib/2016-07-01-preview/generated/azure_mgmt_server_management/gateway.rb', line 358

def list_async(custom_headers = 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.ServerManagement/gateways'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'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 MsRest::HttpOperationError.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::ServerManagement::Mgmt::V2016_07_01_preview::Models::GatewayResources.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_for_resource_group(resource_group_name, custom_headers = nil) ⇒ Array<GatewayResource>

Returns gateways in a resource group.

identifies the resource group within the user subscriptionId. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The resource group name uniquely

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

    A hash of custom headers that

Returns:

  • (Array<GatewayResource>)

    operation results.



418
419
420
421
# File 'lib/2016-07-01-preview/generated/azure_mgmt_server_management/gateway.rb', line 418

def list_for_resource_group(resource_group_name, custom_headers = nil)
  first_page = list_for_resource_group_as_lazy(resource_group_name, custom_headers)
  first_page.get_all_items
end

#list_for_resource_group_as_lazy(resource_group_name, custom_headers = nil) ⇒ GatewayResources

Returns gateways in a resource group.

identifies the resource group within the user subscriptionId. will be added to the HTTP request.

response.

Parameters:

  • resource_group_name (String)

    The resource group name uniquely

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

    A hash of custom headers that

Returns:

  • (GatewayResources)

    which provide lazy access to pages of the



1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
# File 'lib/2016-07-01-preview/generated/azure_mgmt_server_management/gateway.rb', line 1351

def list_for_resource_group_as_lazy(resource_group_name, custom_headers = nil)
  response = list_for_resource_group_async(resource_group_name, custom_headers).value!
  unless response.nil?
    page = response.body
    page.next_method = Proc.new do |next_page_link|
      list_for_resource_group_next_async(next_page_link, custom_headers)
    end
    page
  end
end

#list_for_resource_group_async(resource_group_name, custom_headers = nil) ⇒ Concurrent::Promise

Returns gateways in a resource group.

identifies the resource group within the user subscriptionId. to the HTTP request.

Parameters:

  • resource_group_name (String)

    The resource group name uniquely

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



447
448
449
450
451
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
495
496
# File 'lib/2016-07-01-preview/generated/azure_mgmt_server_management/gateway.rb', line 447

def list_for_resource_group_async(resource_group_name, custom_headers = 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?
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.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.ServerManagement/gateways'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name},
      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 MsRest::HttpOperationError.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::ServerManagement::Mgmt::V2016_07_01_preview::Models::GatewayResources.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_for_resource_group_next(next_page_link, custom_headers = nil) ⇒ GatewayResources

Returns gateways in a resource group.

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:

  • (GatewayResources)

    operation results.



1243
1244
1245
1246
# File 'lib/2016-07-01-preview/generated/azure_mgmt_server_management/gateway.rb', line 1243

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

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

Returns gateways in a resource group.

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.



1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
# File 'lib/2016-07-01-preview/generated/azure_mgmt_server_management/gateway.rb', line 1272

def list_for_resource_group_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 MsRest::HttpOperationError.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::ServerManagement::Mgmt::V2016_07_01_preview::Models::GatewayResources.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_for_resource_group_next_with_http_info(next_page_link, custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse

Returns gateways in a resource group.

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.



1258
1259
1260
# File 'lib/2016-07-01-preview/generated/azure_mgmt_server_management/gateway.rb', line 1258

def list_for_resource_group_next_with_http_info(next_page_link, custom_headers = nil)
  list_for_resource_group_next_async(next_page_link, custom_headers).value!
end

#list_for_resource_group_with_http_info(resource_group_name, custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse

Returns gateways in a resource group.

identifies the resource group within the user subscriptionId. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The resource group name uniquely

  • 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/2016-07-01-preview/generated/azure_mgmt_server_management/gateway.rb', line 433

def list_for_resource_group_with_http_info(resource_group_name, custom_headers = nil)
  list_for_resource_group_async(resource_group_name, custom_headers).value!
end

#list_next(next_page_link, custom_headers = nil) ⇒ GatewayResources

Returns gateways in a subscription.

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:

  • (GatewayResources)

    operation results.



1156
1157
1158
1159
# File 'lib/2016-07-01-preview/generated/azure_mgmt_server_management/gateway.rb', line 1156

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

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

Returns gateways in a subscription.

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.



1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
# File 'lib/2016-07-01-preview/generated/azure_mgmt_server_management/gateway.rb', line 1185

def list_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 MsRest::HttpOperationError.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::ServerManagement::Mgmt::V2016_07_01_preview::Models::GatewayResources.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_next_with_http_info(next_page_link, custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse

Returns gateways in a subscription.

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.



1171
1172
1173
# File 'lib/2016-07-01-preview/generated/azure_mgmt_server_management/gateway.rb', line 1171

def list_next_with_http_info(next_page_link, custom_headers = nil)
  list_next_async(next_page_link, custom_headers).value!
end

#list_with_http_info(custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse

Returns gateways in a subscription.

will be added to the HTTP request.

Parameters:

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



346
347
348
# File 'lib/2016-07-01-preview/generated/azure_mgmt_server_management/gateway.rb', line 346

def list_with_http_info(custom_headers = nil)
  list_async(custom_headers).value!
end

#regenerate_profile(resource_group_name, gateway_name, custom_headers = nil) ⇒ Object

Regenerate a gateway’s profile

identifies the resource group within the user subscriptionId. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The resource group name uniquely

  • gateway_name (String)

    The gateway name (256 characters maximum).

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

    A hash of custom headers that



547
548
549
550
# File 'lib/2016-07-01-preview/generated/azure_mgmt_server_management/gateway.rb', line 547

def regenerate_profile(resource_group_name, gateway_name, custom_headers = nil)
  response = regenerate_profile_async(resource_group_name, gateway_name, custom_headers).value!
  nil
end

#regenerate_profile_async(resource_group_name, gateway_name, custom_headers = nil) ⇒ Concurrent::Promise

identifies the resource group within the user subscriptionId. will be added to the HTTP request.

response.

Parameters:

  • resource_group_name (String)

    The resource group name uniquely

  • gateway_name (String)

    The gateway name (256 characters maximum).

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

    A hash of custom headers that

Returns:

  • (Concurrent::Promise)

    promise which provides async access to http



562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
# File 'lib/2016-07-01-preview/generated/azure_mgmt_server_management/gateway.rb', line 562

def regenerate_profile_async(resource_group_name, gateway_name, custom_headers = nil)
  # Send request
  promise = begin_regenerate_profile_async(resource_group_name, gateway_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

#update(resource_group_name, gateway_name, location = nil, tags = nil, upgrade_mode = nil, custom_headers = nil) ⇒ GatewayResource

Updates a gateway belonging to a resource group.

identifies the resource group within the user subscriptionId. flexibility to gateway to auto upgrade itself. If properties value not specified, then we assume upgradeMode = Automatic. Possible values include: ‘Manual’, ‘Automatic’ will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The resource group name uniquely

  • gateway_name (String)

    The gateway name (256 characters maximum).

  • location (String) (defaults to: nil)

    Location of the resource.

  • tags (defaults to: nil)

    Resource tags.

  • upgrade_mode (UpgradeMode) (defaults to: nil)

    The upgradeMode property gives the

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

    A hash of custom headers that

Returns:

  • (GatewayResource)

    operation results.



97
98
99
100
# File 'lib/2016-07-01-preview/generated/azure_mgmt_server_management/gateway.rb', line 97

def update(resource_group_name, gateway_name, location = nil, tags = nil, upgrade_mode = nil, custom_headers = nil)
  response = update_async(resource_group_name, gateway_name, location, tags, upgrade_mode, custom_headers).value!
  response.body unless response.nil?
end

#update_async(resource_group_name, gateway_name, location = nil, tags = nil, upgrade_mode = nil, custom_headers = nil) ⇒ Concurrent::Promise

identifies the resource group within the user subscriptionId. flexibility to gateway to auto upgrade itself. If properties value not specified, then we assume upgradeMode = Automatic. Possible values include: ‘Manual’, ‘Automatic’ will be added to the HTTP request.

response.

Parameters:

  • resource_group_name (String)

    The resource group name uniquely

  • gateway_name (String)

    The gateway name (256 characters maximum).

  • location (String) (defaults to: nil)

    Location of the resource.

  • tags (defaults to: nil)

    Resource tags.

  • upgrade_mode (UpgradeMode) (defaults to: nil)

    The upgradeMode property gives the

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

    A hash of custom headers that

Returns:

  • (Concurrent::Promise)

    promise which provides async access to http



118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
# File 'lib/2016-07-01-preview/generated/azure_mgmt_server_management/gateway.rb', line 118

def update_async(resource_group_name, gateway_name, location = nil, tags = nil, upgrade_mode = nil, custom_headers = nil)
  # Send request
  promise = begin_update_async(resource_group_name, gateway_name, location, tags, upgrade_mode, custom_headers)

  promise = promise.then do |response|
    # Defining deserialization method.
    deserialize_method = lambda do |parsed_response|
      result_mapper = Azure::ServerManagement::Mgmt::V2016_07_01_preview::Models::GatewayResource.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

#upgrade(resource_group_name, gateway_name, custom_headers = nil) ⇒ Object

Upgrades a gateway.

identifies the resource group within the user subscriptionId. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The resource group name uniquely

  • gateway_name (String)

    The gateway name (256 characters maximum).

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

    A hash of custom headers that



507
508
509
510
# File 'lib/2016-07-01-preview/generated/azure_mgmt_server_management/gateway.rb', line 507

def upgrade(resource_group_name, gateway_name, custom_headers = nil)
  response = upgrade_async(resource_group_name, gateway_name, custom_headers).value!
  nil
end

#upgrade_async(resource_group_name, gateway_name, custom_headers = nil) ⇒ Concurrent::Promise

identifies the resource group within the user subscriptionId. will be added to the HTTP request.

response.

Parameters:

  • resource_group_name (String)

    The resource group name uniquely

  • gateway_name (String)

    The gateway name (256 characters maximum).

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

    A hash of custom headers that

Returns:

  • (Concurrent::Promise)

    promise which provides async access to http



522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
# File 'lib/2016-07-01-preview/generated/azure_mgmt_server_management/gateway.rb', line 522

def upgrade_async(resource_group_name, gateway_name, custom_headers = nil)
  # Send request
  promise = begin_upgrade_async(resource_group_name, gateway_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