Class: Azure::ServerManagement::Mgmt::V2016_07_01_preview::Gateway
- Inherits:
-
Object
- Object
- Azure::ServerManagement::Mgmt::V2016_07_01_preview::Gateway
- 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
-
#client ⇒ ServerManagement
readonly
Reference to the ServerManagement.
Instance Method Summary collapse
-
#begin_create(resource_group_name, gateway_name, location: nil, tags: nil, upgrade_mode: nil, custom_headers: nil) ⇒ GatewayResource
Creates or updates a ManagementService gateway.
-
#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.
-
#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.
-
#begin_get_profile(resource_group_name, gateway_name, custom_headers: nil) ⇒ GatewayProfile
Gets a gateway profile.
-
#begin_get_profile_async(resource_group_name, gateway_name, custom_headers: nil) ⇒ Concurrent::Promise
Gets a gateway profile.
-
#begin_get_profile_with_http_info(resource_group_name, gateway_name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Gets a gateway profile.
-
#begin_regenerate_profile(resource_group_name, gateway_name, custom_headers: nil) ⇒ Object
Regenerate a gateway’s profile.
-
#begin_regenerate_profile_async(resource_group_name, gateway_name, custom_headers: nil) ⇒ Concurrent::Promise
Regenerate a gateway’s profile.
-
#begin_regenerate_profile_with_http_info(resource_group_name, gateway_name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Regenerate a gateway’s profile.
-
#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.
-
#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.
-
#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.
-
#begin_upgrade(resource_group_name, gateway_name, custom_headers: nil) ⇒ Object
Upgrades a gateway.
-
#begin_upgrade_async(resource_group_name, gateway_name, custom_headers: nil) ⇒ Concurrent::Promise
Upgrades a gateway.
-
#begin_upgrade_with_http_info(resource_group_name, gateway_name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Upgrades a gateway.
-
#create(resource_group_name, gateway_name, location: nil, tags: nil, upgrade_mode: nil, custom_headers: nil) ⇒ GatewayResource
Creates or updates a ManagementService gateway.
-
#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.
-
#delete(resource_group_name, gateway_name, custom_headers: nil) ⇒ Object
Deletes a gateway from a resource group.
-
#delete_async(resource_group_name, gateway_name, custom_headers: nil) ⇒ Concurrent::Promise
Deletes a gateway from a resource group.
-
#delete_with_http_info(resource_group_name, gateway_name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Deletes a gateway from a resource group.
-
#get(resource_group_name, gateway_name, expand: nil, custom_headers: nil) ⇒ GatewayResource
Gets a gateway.
-
#get_async(resource_group_name, gateway_name, expand: nil, custom_headers: nil) ⇒ Concurrent::Promise
Gets a gateway.
-
#get_profile(resource_group_name, gateway_name, custom_headers: nil) ⇒ GatewayProfile
Gets a gateway profile.
-
#get_profile_async(resource_group_name, gateway_name, custom_headers: nil) ⇒ Concurrent::Promise
identifies the resource group within the user subscriptionId.
-
#get_with_http_info(resource_group_name, gateway_name, expand: nil, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Gets a gateway.
-
#initialize(client) ⇒ Gateway
constructor
Creates and initializes a new instance of the Gateway class.
-
#list(custom_headers: nil) ⇒ Array<GatewayResource>
Returns gateways in a subscription.
-
#list_as_lazy(custom_headers: nil) ⇒ GatewayResources
Returns gateways in a subscription.
-
#list_async(custom_headers: nil) ⇒ Concurrent::Promise
Returns gateways in a subscription.
-
#list_for_resource_group(resource_group_name, custom_headers: nil) ⇒ Array<GatewayResource>
Returns gateways in a resource group.
-
#list_for_resource_group_as_lazy(resource_group_name, custom_headers: nil) ⇒ GatewayResources
Returns gateways in a resource group.
-
#list_for_resource_group_async(resource_group_name, custom_headers: nil) ⇒ Concurrent::Promise
Returns gateways in a resource group.
-
#list_for_resource_group_next(next_page_link, custom_headers: nil) ⇒ GatewayResources
Returns gateways in a resource group.
-
#list_for_resource_group_next_async(next_page_link, custom_headers: nil) ⇒ Concurrent::Promise
Returns gateways in a resource group.
-
#list_for_resource_group_next_with_http_info(next_page_link, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Returns gateways in a resource group.
-
#list_for_resource_group_with_http_info(resource_group_name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Returns gateways in a resource group.
-
#list_next(next_page_link, custom_headers: nil) ⇒ GatewayResources
Returns gateways in a subscription.
-
#list_next_async(next_page_link, custom_headers: nil) ⇒ Concurrent::Promise
Returns gateways in a subscription.
-
#list_next_with_http_info(next_page_link, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Returns gateways in a subscription.
-
#list_with_http_info(custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Returns gateways in a subscription.
-
#regenerate_profile(resource_group_name, gateway_name, custom_headers: nil) ⇒ Object
Regenerate a gateway’s profile.
-
#regenerate_profile_async(resource_group_name, gateway_name, custom_headers: nil) ⇒ Concurrent::Promise
identifies the resource group within the user subscriptionId.
-
#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.
-
#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.
-
#upgrade(resource_group_name, gateway_name, custom_headers: nil) ⇒ Object
Upgrades a gateway.
-
#upgrade_async(resource_group_name, gateway_name, custom_headers: nil) ⇒ Concurrent::Promise
identifies the resource group within the user subscriptionId.
Constructor Details
#initialize(client) ⇒ Gateway
Creates and initializes a new instance of the Gateway class.
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
#client ⇒ ServerManagement (readonly)
Returns reference to the ServerManagement.
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.
655 656 657 658 |
# File 'lib/2016-07-01-preview/generated/azure_mgmt_server_management/gateway.rb', line 655 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:location, tags:, upgrade_mode:upgrade_mode, custom_headers: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.
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 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 |
# File 'lib/2016-07-01-preview/generated/azure_mgmt_server_management/gateway.rb', line 698 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, "'resource_group_name' should satisfy the constraint - 'MinLength': '3'" if !resource_group_name.nil? && resource_group_name.length < 3 fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '[a-zA-Z0-9]+'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^[a-zA-Z0-9]+$')).nil? fail ArgumentError, 'gateway_name is nil' if gateway_name.nil? fail ArgumentError, "'gateway_name' should satisfy the constraint - 'MaxLength': '256'" if !gateway_name.nil? && gateway_name.length > 256 fail ArgumentError, "'gateway_name' should satisfy the constraint - 'MinLength': '1'" if !gateway_name.nil? && gateway_name.length < 1 fail ArgumentError, "'gateway_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z0-9][a-zA-Z0-9_.-]*$'" if !gateway_name.nil? && gateway_name.match(Regexp.new('^^[a-zA-Z0-9][a-zA-Z0-9_.-]*$$')).nil? gateway_parameters = GatewayParameters.new unless location.nil? && .nil? && upgrade_mode.nil? gateway_parameters.location = location gateway_parameters. = gateway_parameters.upgrade_mode = upgrade_mode end request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? # 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 = { 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, ) 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., 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., 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.
677 678 679 |
# File 'lib/2016-07-01-preview/generated/azure_mgmt_server_management/gateway.rb', line 677 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:location, tags:, upgrade_mode:upgrade_mode, custom_headers: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.
1099 1100 1101 1102 |
# File 'lib/2016-07-01-preview/generated/azure_mgmt_server_management/gateway.rb', line 1099 def begin_get_profile(resource_group_name, gateway_name, custom_headers:nil) response = begin_get_profile_async(resource_group_name, gateway_name, custom_headers: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.
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 |
# File 'lib/2016-07-01-preview/generated/azure_mgmt_server_management/gateway.rb', line 1130 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, "'resource_group_name' should satisfy the constraint - 'MinLength': '3'" if !resource_group_name.nil? && resource_group_name.length < 3 fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '[a-zA-Z0-9]+'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^[a-zA-Z0-9]+$')).nil? fail ArgumentError, 'gateway_name is nil' if gateway_name.nil? fail ArgumentError, "'gateway_name' should satisfy the constraint - 'MaxLength': '256'" if !gateway_name.nil? && gateway_name.length > 256 fail ArgumentError, "'gateway_name' should satisfy the constraint - 'MinLength': '1'" if !gateway_name.nil? && gateway_name.length < 1 fail ArgumentError, "'gateway_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z0-9][a-zA-Z0-9_.-]*$'" if !gateway_name.nil? && gateway_name.match(Regexp.new('^^[a-zA-Z0-9][a-zA-Z0-9_.-]*$$')).nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # 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 = { 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, ) 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., 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.
1115 1116 1117 |
# File 'lib/2016-07-01-preview/generated/azure_mgmt_server_management/gateway.rb', line 1115 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: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.
1009 1010 1011 1012 |
# File 'lib/2016-07-01-preview/generated/azure_mgmt_server_management/gateway.rb', line 1009 def begin_regenerate_profile(resource_group_name, gateway_name, custom_headers:nil) response = begin_regenerate_profile_async(resource_group_name, gateway_name, custom_headers: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.
1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 |
# File 'lib/2016-07-01-preview/generated/azure_mgmt_server_management/gateway.rb', line 1040 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, "'resource_group_name' should satisfy the constraint - 'MinLength': '3'" if !resource_group_name.nil? && resource_group_name.length < 3 fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '[a-zA-Z0-9]+'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^[a-zA-Z0-9]+$')).nil? fail ArgumentError, 'gateway_name is nil' if gateway_name.nil? fail ArgumentError, "'gateway_name' should satisfy the constraint - 'MaxLength': '256'" if !gateway_name.nil? && gateway_name.length > 256 fail ArgumentError, "'gateway_name' should satisfy the constraint - 'MinLength': '1'" if !gateway_name.nil? && gateway_name.length < 1 fail ArgumentError, "'gateway_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z0-9][a-zA-Z0-9_.-]*$'" if !gateway_name.nil? && gateway_name.match(Regexp.new('^^[a-zA-Z0-9][a-zA-Z0-9_.-]*$$')).nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # 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 = { 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, ) 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.
1025 1026 1027 |
# File 'lib/2016-07-01-preview/generated/azure_mgmt_server_management/gateway.rb', line 1025 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: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.
796 797 798 799 |
# File 'lib/2016-07-01-preview/generated/azure_mgmt_server_management/gateway.rb', line 796 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:location, tags:, upgrade_mode:upgrade_mode, custom_headers: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.
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 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 |
# File 'lib/2016-07-01-preview/generated/azure_mgmt_server_management/gateway.rb', line 839 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, "'resource_group_name' should satisfy the constraint - 'MinLength': '3'" if !resource_group_name.nil? && resource_group_name.length < 3 fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '[a-zA-Z0-9]+'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^[a-zA-Z0-9]+$')).nil? fail ArgumentError, 'gateway_name is nil' if gateway_name.nil? fail ArgumentError, "'gateway_name' should satisfy the constraint - 'MaxLength': '256'" if !gateway_name.nil? && gateway_name.length > 256 fail ArgumentError, "'gateway_name' should satisfy the constraint - 'MinLength': '1'" if !gateway_name.nil? && gateway_name.length < 1 fail ArgumentError, "'gateway_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z0-9][a-zA-Z0-9_.-]*$'" if !gateway_name.nil? && gateway_name.match(Regexp.new('^^[a-zA-Z0-9][a-zA-Z0-9_.-]*$$')).nil? gateway_parameters = GatewayParameters.new unless location.nil? && .nil? && upgrade_mode.nil? gateway_parameters.location = location gateway_parameters. = gateway_parameters.upgrade_mode = upgrade_mode end request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? # 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 = { 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, ) 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., 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.
818 819 820 |
# File 'lib/2016-07-01-preview/generated/azure_mgmt_server_management/gateway.rb', line 818 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:location, tags:, upgrade_mode:upgrade_mode, custom_headers: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.
920 921 922 923 |
# File 'lib/2016-07-01-preview/generated/azure_mgmt_server_management/gateway.rb', line 920 def begin_upgrade(resource_group_name, gateway_name, custom_headers:nil) response = begin_upgrade_async(resource_group_name, gateway_name, custom_headers: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.
951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 |
# File 'lib/2016-07-01-preview/generated/azure_mgmt_server_management/gateway.rb', line 951 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, "'resource_group_name' should satisfy the constraint - 'MinLength': '3'" if !resource_group_name.nil? && resource_group_name.length < 3 fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '[a-zA-Z0-9]+'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^[a-zA-Z0-9]+$')).nil? fail ArgumentError, 'gateway_name is nil' if gateway_name.nil? fail ArgumentError, "'gateway_name' should satisfy the constraint - 'MaxLength': '256'" if !gateway_name.nil? && gateway_name.length > 256 fail ArgumentError, "'gateway_name' should satisfy the constraint - 'MinLength': '1'" if !gateway_name.nil? && gateway_name.length < 1 fail ArgumentError, "'gateway_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z0-9][a-zA-Z0-9_.-]*$'" if !gateway_name.nil? && gateway_name.match(Regexp.new('^^[a-zA-Z0-9][a-zA-Z0-9_.-]*$$')).nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # 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 = { 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, ) 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.
936 937 938 |
# File 'lib/2016-07-01-preview/generated/azure_mgmt_server_management/gateway.rb', line 936 def begin_upgrade_with_http_info(resource_group_name, gateway_name, custom_headers:nil) begin_upgrade_async(resource_group_name, gateway_name, custom_headers: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.
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:location, tags:, upgrade_mode:upgrade_mode, custom_headers: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.
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:location, tags:, upgrade_mode:upgrade_mode, custom_headers: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.
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: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.
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 218 219 220 221 222 223 |
# 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, "'resource_group_name' should satisfy the constraint - 'MinLength': '3'" if !resource_group_name.nil? && resource_group_name.length < 3 fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '[a-zA-Z0-9]+'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^[a-zA-Z0-9]+$')).nil? fail ArgumentError, 'gateway_name is nil' if gateway_name.nil? fail ArgumentError, "'gateway_name' should satisfy the constraint - 'MaxLength': '256'" if !gateway_name.nil? && gateway_name.length > 256 fail ArgumentError, "'gateway_name' should satisfy the constraint - 'MinLength': '1'" if !gateway_name.nil? && gateway_name.length < 1 fail ArgumentError, "'gateway_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z0-9][a-zA-Z0-9_.-]*$'" if !gateway_name.nil? && gateway_name.match(Regexp.new('^^[a-zA-Z0-9][a-zA-Z0-9_.-]*$$')).nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # 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 = { 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, ) 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.
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: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.
240 241 242 243 |
# File 'lib/2016-07-01-preview/generated/azure_mgmt_server_management/gateway.rb', line 240 def get(resource_group_name, gateway_name, expand:nil, custom_headers:nil) response = get_async(resource_group_name, gateway_name, expand:, custom_headers: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.
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 324 325 326 327 328 329 330 331 332 333 334 335 |
# File 'lib/2016-07-01-preview/generated/azure_mgmt_server_management/gateway.rb', line 279 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, "'resource_group_name' should satisfy the constraint - 'MinLength': '3'" if !resource_group_name.nil? && resource_group_name.length < 3 fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '[a-zA-Z0-9]+'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^[a-zA-Z0-9]+$')).nil? fail ArgumentError, 'gateway_name is nil' if gateway_name.nil? fail ArgumentError, "'gateway_name' should satisfy the constraint - 'MaxLength': '256'" if !gateway_name.nil? && gateway_name.length > 256 fail ArgumentError, "'gateway_name' should satisfy the constraint - 'MinLength': '1'" if !gateway_name.nil? && gateway_name.length < 1 fail ArgumentError, "'gateway_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z0-9][a-zA-Z0-9_.-]*$'" if !gateway_name.nil? && gateway_name.match(Regexp.new('^^[a-zA-Z0-9][a-zA-Z0-9_.-]*$$')).nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # 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 = { 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' => }, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = @client.make_request_async(:get, path_template, ) 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., 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.
605 606 607 608 |
# File 'lib/2016-07-01-preview/generated/azure_mgmt_server_management/gateway.rb', line 605 def get_profile(resource_group_name, gateway_name, custom_headers:nil) response = get_profile_async(resource_group_name, gateway_name, custom_headers: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.
620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 |
# File 'lib/2016-07-01-preview/generated/azure_mgmt_server_management/gateway.rb', line 620 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: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.
260 261 262 |
# File 'lib/2016-07-01-preview/generated/azure_mgmt_server_management/gateway.rb', line 260 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:custom_headers).value! end |
#list(custom_headers: nil) ⇒ Array<GatewayResource>
Returns gateways in a subscription.
will be added to the HTTP request.
345 346 347 348 |
# File 'lib/2016-07-01-preview/generated/azure_mgmt_server_management/gateway.rb', line 345 def list(custom_headers:nil) first_page = list_as_lazy(custom_headers: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.
1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 |
# File 'lib/2016-07-01-preview/generated/azure_mgmt_server_management/gateway.rb', line 1373 def list_as_lazy(custom_headers:nil) response = list_async(custom_headers: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:custom_headers) end page end end |
#list_async(custom_headers: nil) ⇒ Concurrent::Promise
Returns gateways in a subscription.
to the HTTP request.
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 407 408 409 410 411 412 413 414 415 416 417 418 419 |
# File 'lib/2016-07-01-preview/generated/azure_mgmt_server_management/gateway.rb', line 370 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 = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # 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 = { 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, ) 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., 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.
431 432 433 434 |
# File 'lib/2016-07-01-preview/generated/azure_mgmt_server_management/gateway.rb', line 431 def list_for_resource_group(resource_group_name, custom_headers:nil) first_page = list_for_resource_group_as_lazy(resource_group_name, custom_headers: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.
1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 |
# File 'lib/2016-07-01-preview/generated/azure_mgmt_server_management/gateway.rb', line 1395 def list_for_resource_group_as_lazy(resource_group_name, custom_headers:nil) response = list_for_resource_group_async(resource_group_name, custom_headers: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: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.
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 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 |
# File 'lib/2016-07-01-preview/generated/azure_mgmt_server_management/gateway.rb', line 460 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? fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '3'" if !resource_group_name.nil? && resource_group_name.length < 3 fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '[a-zA-Z0-9]+'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^[a-zA-Z0-9]+$')).nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # 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 = { 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, ) 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., 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.
1286 1287 1288 1289 |
# File 'lib/2016-07-01-preview/generated/azure_mgmt_server_management/gateway.rb', line 1286 def list_for_resource_group_next(next_page_link, custom_headers:nil) response = list_for_resource_group_next_async(next_page_link, custom_headers: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.
1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 |
# File 'lib/2016-07-01-preview/generated/azure_mgmt_server_management/gateway.rb', line 1315 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 = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # 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 = { 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, ) 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., 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.
1301 1302 1303 |
# File 'lib/2016-07-01-preview/generated/azure_mgmt_server_management/gateway.rb', line 1301 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: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.
446 447 448 |
# File 'lib/2016-07-01-preview/generated/azure_mgmt_server_management/gateway.rb', line 446 def list_for_resource_group_with_http_info(resource_group_name, custom_headers:nil) list_for_resource_group_async(resource_group_name, custom_headers: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.
1198 1199 1200 1201 |
# File 'lib/2016-07-01-preview/generated/azure_mgmt_server_management/gateway.rb', line 1198 def list_next(next_page_link, custom_headers:nil) response = list_next_async(next_page_link, custom_headers: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.
1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 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 |
# File 'lib/2016-07-01-preview/generated/azure_mgmt_server_management/gateway.rb', line 1227 def list_next_async(next_page_link, custom_headers:nil) fail ArgumentError, 'next_page_link is nil' if next_page_link.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # 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 = { 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, ) 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., 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.
1213 1214 1215 |
# File 'lib/2016-07-01-preview/generated/azure_mgmt_server_management/gateway.rb', line 1213 def list_next_with_http_info(next_page_link, custom_headers:nil) list_next_async(next_page_link, custom_headers: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.
358 359 360 |
# File 'lib/2016-07-01-preview/generated/azure_mgmt_server_management/gateway.rb', line 358 def list_with_http_info(custom_headers:nil) list_async(custom_headers: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.
563 564 565 566 |
# File 'lib/2016-07-01-preview/generated/azure_mgmt_server_management/gateway.rb', line 563 def regenerate_profile(resource_group_name, gateway_name, custom_headers:nil) response = regenerate_profile_async(resource_group_name, gateway_name, custom_headers: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.
578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 |
# File 'lib/2016-07-01-preview/generated/azure_mgmt_server_management/gateway.rb', line 578 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: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.
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:location, tags:, upgrade_mode:upgrade_mode, custom_headers: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.
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:location, tags:, upgrade_mode:upgrade_mode, custom_headers: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.
523 524 525 526 |
# File 'lib/2016-07-01-preview/generated/azure_mgmt_server_management/gateway.rb', line 523 def upgrade(resource_group_name, gateway_name, custom_headers:nil) response = upgrade_async(resource_group_name, gateway_name, custom_headers: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.
538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 |
# File 'lib/2016-07-01-preview/generated/azure_mgmt_server_management/gateway.rb', line 538 def upgrade_async(resource_group_name, gateway_name, custom_headers:nil) # Send request promise = begin_upgrade_async(resource_group_name, gateway_name, custom_headers: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 |