azure_mgmt_redis 0.14.0 → 0.15.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/2015-08-01/generated/azure_mgmt_redis.rb +43 -0
- data/lib/{generated → 2015-08-01/generated}/azure_mgmt_redis/models/reboot_type.rb +1 -1
- data/lib/2015-08-01/generated/azure_mgmt_redis/models/redis_access_keys.rb +56 -0
- data/lib/2015-08-01/generated/azure_mgmt_redis/models/redis_create_or_update_parameters.rb +194 -0
- data/lib/{generated → 2015-08-01/generated}/azure_mgmt_redis/models/redis_key_type.rb +1 -1
- data/lib/2015-08-01/generated/azure_mgmt_redis/models/redis_list_keys_result.rb +56 -0
- data/lib/2015-08-01/generated/azure_mgmt_redis/models/redis_list_result.rb +94 -0
- data/lib/2015-08-01/generated/azure_mgmt_redis/models/redis_properties.rb +149 -0
- data/lib/2015-08-01/generated/azure_mgmt_redis/models/redis_reboot_parameters.rb +58 -0
- data/lib/2015-08-01/generated/azure_mgmt_redis/models/redis_regenerate_key_parameters.rb +46 -0
- data/lib/2015-08-01/generated/azure_mgmt_redis/models/redis_resource.rb +234 -0
- data/lib/2015-08-01/generated/azure_mgmt_redis/models/redis_resource_with_access_key.rb +245 -0
- data/lib/2015-08-01/generated/azure_mgmt_redis/models/resource.rb +95 -0
- data/lib/2015-08-01/generated/azure_mgmt_redis/models/sku.rb +68 -0
- data/lib/{generated → 2015-08-01/generated}/azure_mgmt_redis/models/sku_family.rb +1 -1
- data/lib/{generated → 2015-08-01/generated}/azure_mgmt_redis/models/sku_name.rb +1 -1
- data/lib/2015-08-01/generated/azure_mgmt_redis/module_definition.rb +9 -0
- data/lib/2015-08-01/generated/azure_mgmt_redis/redis.rb +1002 -0
- data/lib/2015-08-01/generated/azure_mgmt_redis/redis_management_client.rb +131 -0
- data/lib/{generated → 2015-08-01/generated}/azure_mgmt_redis/version.rb +2 -2
- data/lib/2016-04-01/generated/azure_mgmt_redis.rb +56 -0
- data/lib/2016-04-01/generated/azure_mgmt_redis/firewall_rules.rb +225 -0
- data/lib/{generated → 2016-04-01/generated}/azure_mgmt_redis/models/day_of_week.rb +1 -1
- data/lib/{generated → 2016-04-01/generated}/azure_mgmt_redis/models/export_rdbparameters.rb +1 -1
- data/lib/{generated → 2016-04-01/generated}/azure_mgmt_redis/models/import_rdbparameters.rb +1 -1
- data/lib/{generated → 2016-04-01/generated}/azure_mgmt_redis/models/operation.rb +1 -1
- data/lib/{generated → 2016-04-01/generated}/azure_mgmt_redis/models/operation_display.rb +1 -1
- data/lib/2016-04-01/generated/azure_mgmt_redis/models/operation_list_result.rb +97 -0
- data/lib/2016-04-01/generated/azure_mgmt_redis/models/reboot_type.rb +17 -0
- data/lib/{generated → 2016-04-01/generated}/azure_mgmt_redis/models/redis_access_keys.rb +1 -1
- data/lib/2016-04-01/generated/azure_mgmt_redis/models/redis_create_parameters.rb +177 -0
- data/lib/2016-04-01/generated/azure_mgmt_redis/models/redis_firewall_rule.rb +89 -0
- data/lib/2016-04-01/generated/azure_mgmt_redis/models/redis_firewall_rule_list_result.rb +95 -0
- data/lib/{generated → 2016-04-01/generated}/azure_mgmt_redis/models/redis_force_reboot_response.rb +1 -1
- data/lib/2016-04-01/generated/azure_mgmt_redis/models/redis_key_type.rb +16 -0
- data/lib/2016-04-01/generated/azure_mgmt_redis/models/redis_list_result.rb +94 -0
- data/lib/{generated → 2016-04-01/generated}/azure_mgmt_redis/models/redis_patch_schedule.rb +1 -1
- data/lib/{generated → 2016-04-01/generated}/azure_mgmt_redis/models/redis_reboot_parameters.rb +1 -1
- data/lib/{generated → 2016-04-01/generated}/azure_mgmt_redis/models/redis_regenerate_key_parameters.rb +1 -1
- data/lib/2016-04-01/generated/azure_mgmt_redis/models/redis_resource.rb +245 -0
- data/lib/{generated → 2016-04-01/generated}/azure_mgmt_redis/models/redis_update_parameters.rb +1 -1
- data/lib/2016-04-01/generated/azure_mgmt_redis/models/resource.rb +94 -0
- data/lib/{generated → 2016-04-01/generated}/azure_mgmt_redis/models/schedule_entry.rb +1 -1
- data/lib/{generated → 2016-04-01/generated}/azure_mgmt_redis/models/sku.rb +1 -1
- data/lib/2016-04-01/generated/azure_mgmt_redis/models/sku_family.rb +16 -0
- data/lib/2016-04-01/generated/azure_mgmt_redis/models/sku_name.rb +17 -0
- data/lib/2016-04-01/generated/azure_mgmt_redis/module_definition.rb +9 -0
- data/lib/{generated → 2016-04-01/generated}/azure_mgmt_redis/operations.rb +3 -3
- data/lib/{generated → 2016-04-01/generated}/azure_mgmt_redis/patch_schedules.rb +5 -5
- data/lib/{generated → 2016-04-01/generated}/azure_mgmt_redis/redis.rb +19 -19
- data/lib/2016-04-01/generated/azure_mgmt_redis/redis_firewall_rule_operations.rb +325 -0
- data/lib/2016-04-01/generated/azure_mgmt_redis/redis_management_client.rb +147 -0
- data/lib/{generated/azure_mgmt_redis/module_definition.rb → 2016-04-01/generated/azure_mgmt_redis/version.rb} +3 -3
- data/lib/{generated → 2017-02-01/generated}/azure_mgmt_redis.rb +40 -40
- data/lib/{generated → 2017-02-01/generated}/azure_mgmt_redis/firewall_rules.rb +7 -7
- data/lib/2017-02-01/generated/azure_mgmt_redis/models/day_of_week.rb +23 -0
- data/lib/2017-02-01/generated/azure_mgmt_redis/models/export_rdbparameters.rb +64 -0
- data/lib/2017-02-01/generated/azure_mgmt_redis/models/import_rdbparameters.rb +61 -0
- data/lib/2017-02-01/generated/azure_mgmt_redis/models/operation.rb +55 -0
- data/lib/2017-02-01/generated/azure_mgmt_redis/models/operation_display.rb +75 -0
- data/lib/{generated → 2017-02-01/generated}/azure_mgmt_redis/models/operation_list_result.rb +1 -1
- data/lib/{generated → 2017-02-01/generated}/azure_mgmt_redis/models/proxy_resource.rb +1 -1
- data/lib/2017-02-01/generated/azure_mgmt_redis/models/reboot_type.rb +17 -0
- data/lib/2017-02-01/generated/azure_mgmt_redis/models/redis_access_keys.rb +58 -0
- data/lib/{generated → 2017-02-01/generated}/azure_mgmt_redis/models/redis_create_parameters.rb +1 -1
- data/lib/{generated → 2017-02-01/generated}/azure_mgmt_redis/models/redis_firewall_rule.rb +1 -1
- data/lib/{generated → 2017-02-01/generated}/azure_mgmt_redis/models/redis_firewall_rule_list_result.rb +1 -1
- data/lib/2017-02-01/generated/azure_mgmt_redis/models/redis_force_reboot_response.rb +45 -0
- data/lib/2017-02-01/generated/azure_mgmt_redis/models/redis_key_type.rb +16 -0
- data/lib/{generated → 2017-02-01/generated}/azure_mgmt_redis/models/redis_linked_server.rb +1 -1
- data/lib/{generated → 2017-02-01/generated}/azure_mgmt_redis/models/redis_linked_server_create_parameters.rb +1 -1
- data/lib/{generated → 2017-02-01/generated}/azure_mgmt_redis/models/redis_linked_server_list.rb +1 -1
- data/lib/{generated → 2017-02-01/generated}/azure_mgmt_redis/models/redis_linked_server_with_properties.rb +1 -1
- data/lib/{generated → 2017-02-01/generated}/azure_mgmt_redis/models/redis_linked_server_with_properties_list.rb +1 -1
- data/lib/{generated → 2017-02-01/generated}/azure_mgmt_redis/models/redis_list_result.rb +1 -1
- data/lib/2017-02-01/generated/azure_mgmt_redis/models/redis_patch_schedule.rb +97 -0
- data/lib/2017-02-01/generated/azure_mgmt_redis/models/redis_reboot_parameters.rb +57 -0
- data/lib/2017-02-01/generated/azure_mgmt_redis/models/redis_regenerate_key_parameters.rb +46 -0
- data/lib/{generated → 2017-02-01/generated}/azure_mgmt_redis/models/redis_resource.rb +1 -1
- data/lib/2017-02-01/generated/azure_mgmt_redis/models/redis_update_parameters.rb +149 -0
- data/lib/{generated → 2017-02-01/generated}/azure_mgmt_redis/models/replication_role.rb +1 -1
- data/lib/{generated → 2017-02-01/generated}/azure_mgmt_redis/models/resource.rb +1 -1
- data/lib/2017-02-01/generated/azure_mgmt_redis/models/schedule_entry.rb +68 -0
- data/lib/2017-02-01/generated/azure_mgmt_redis/models/sku.rb +69 -0
- data/lib/2017-02-01/generated/azure_mgmt_redis/models/sku_family.rb +16 -0
- data/lib/2017-02-01/generated/azure_mgmt_redis/models/sku_name.rb +17 -0
- data/lib/{generated → 2017-02-01/generated}/azure_mgmt_redis/models/tracked_resource.rb +1 -1
- data/lib/2017-02-01/generated/azure_mgmt_redis/module_definition.rb +9 -0
- data/lib/2017-02-01/generated/azure_mgmt_redis/operations.rb +220 -0
- data/lib/2017-02-01/generated/azure_mgmt_redis/patch_schedules.rb +316 -0
- data/lib/2017-02-01/generated/azure_mgmt_redis/redis.rb +1481 -0
- data/lib/{generated → 2017-02-01/generated}/azure_mgmt_redis/redis_linked_server_operations.rb +7 -7
- data/lib/{generated → 2017-02-01/generated}/azure_mgmt_redis/redis_management_client.rb +3 -3
- data/lib/2017-02-01/generated/azure_mgmt_redis/version.rb +8 -0
- data/lib/azure_mgmt_redis.rb +4 -1
- data/lib/module_definition.rb +9 -0
- data/lib/profiles/common/configurable.rb +73 -0
- data/lib/profiles/common/default.rb +68 -0
- data/lib/profiles/latest/modules/redis_profile_module.rb +178 -0
- data/lib/profiles/latest/redis_latest_profile_client.rb +33 -0
- data/lib/profiles/latest/redis_module_definition.rb +9 -0
- data/lib/version.rb +7 -0
- metadata +103 -43
@@ -0,0 +1,131 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
# Code generated by Microsoft (R) AutoRest Code Generator.
|
3
|
+
# Changes may cause incorrect behavior and will be lost if the code is
|
4
|
+
# regenerated.
|
5
|
+
|
6
|
+
module Azure::Redis::Mgmt::V2015_08_01
|
7
|
+
#
|
8
|
+
# A service client - single point of access to the REST API.
|
9
|
+
#
|
10
|
+
class RedisManagementClient < MsRestAzure::AzureServiceClient
|
11
|
+
include MsRestAzure
|
12
|
+
include MsRestAzure::Serialization
|
13
|
+
|
14
|
+
# @return [String] the base URI of the service.
|
15
|
+
attr_accessor :base_url
|
16
|
+
|
17
|
+
# @return Credentials needed for the client to connect to Azure.
|
18
|
+
attr_reader :credentials
|
19
|
+
|
20
|
+
# @return [String] Gets subscription credentials which uniquely identify
|
21
|
+
# the Microsoft Azure subscription. The subscription ID forms part of the
|
22
|
+
# URI for every service call.
|
23
|
+
attr_accessor :subscription_id
|
24
|
+
|
25
|
+
# @return [String] Client API Version.
|
26
|
+
attr_reader :api_version
|
27
|
+
|
28
|
+
# @return [String] Gets or sets the preferred language for the response.
|
29
|
+
attr_accessor :accept_language
|
30
|
+
|
31
|
+
# @return [Integer] Gets or sets the retry timeout in seconds for Long
|
32
|
+
# Running Operations. Default value is 30.
|
33
|
+
attr_accessor :long_running_operation_retry_timeout
|
34
|
+
|
35
|
+
# @return [Boolean] When set to true a unique x-ms-client-request-id value
|
36
|
+
# is generated and included in each request. Default is true.
|
37
|
+
attr_accessor :generate_client_request_id
|
38
|
+
|
39
|
+
# @return [Redis] redis
|
40
|
+
attr_reader :redis
|
41
|
+
|
42
|
+
#
|
43
|
+
# Creates initializes a new instance of the RedisManagementClient class.
|
44
|
+
# @param credentials [MsRest::ServiceClientCredentials] credentials to authorize HTTP requests made by the service client.
|
45
|
+
# @param base_url [String] the base URI of the service.
|
46
|
+
# @param options [Array] filters to be applied to the HTTP requests.
|
47
|
+
#
|
48
|
+
def initialize(credentials = nil, base_url = nil, options = nil)
|
49
|
+
super(credentials, options)
|
50
|
+
@base_url = base_url || 'https://management.azure.com'
|
51
|
+
|
52
|
+
fail ArgumentError, 'invalid type of credentials input parameter' unless credentials.is_a?(MsRest::ServiceClientCredentials) unless credentials.nil?
|
53
|
+
@credentials = credentials
|
54
|
+
|
55
|
+
@redis = Redis.new(self)
|
56
|
+
@api_version = '2015-08-01'
|
57
|
+
@accept_language = 'en-US'
|
58
|
+
@long_running_operation_retry_timeout = 30
|
59
|
+
@generate_client_request_id = true
|
60
|
+
add_telemetry
|
61
|
+
end
|
62
|
+
|
63
|
+
#
|
64
|
+
# Makes a request and returns the body of the response.
|
65
|
+
# @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete.
|
66
|
+
# @param path [String] the path, relative to {base_url}.
|
67
|
+
# @param options [Hash{String=>String}] specifying any request options like :body.
|
68
|
+
# @return [Hash{String=>String}] containing the body of the response.
|
69
|
+
# Example:
|
70
|
+
#
|
71
|
+
# request_content = "{'location':'westus','tags':{'tag1':'val1','tag2':'val2'}}"
|
72
|
+
# path = "/path"
|
73
|
+
# options = {
|
74
|
+
# body: request_content,
|
75
|
+
# query_params: {'api-version' => '2016-02-01'}
|
76
|
+
# }
|
77
|
+
# result = @client.make_request(:put, path, options)
|
78
|
+
#
|
79
|
+
def make_request(method, path, options = {})
|
80
|
+
result = make_request_with_http_info(method, path, options)
|
81
|
+
result.body unless result.nil?
|
82
|
+
end
|
83
|
+
|
84
|
+
#
|
85
|
+
# Makes a request and returns the operation response.
|
86
|
+
# @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete.
|
87
|
+
# @param path [String] the path, relative to {base_url}.
|
88
|
+
# @param options [Hash{String=>String}] specifying any request options like :body.
|
89
|
+
# @return [MsRestAzure::AzureOperationResponse] Operation response containing the request, response and status.
|
90
|
+
#
|
91
|
+
def make_request_with_http_info(method, path, options = {})
|
92
|
+
result = make_request_async(method, path, options).value!
|
93
|
+
result.body = result.response.body.to_s.empty? ? nil : JSON.load(result.response.body)
|
94
|
+
result
|
95
|
+
end
|
96
|
+
|
97
|
+
#
|
98
|
+
# Makes a request asynchronously.
|
99
|
+
# @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete.
|
100
|
+
# @param path [String] the path, relative to {base_url}.
|
101
|
+
# @param options [Hash{String=>String}] specifying any request options like :body.
|
102
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
103
|
+
#
|
104
|
+
def make_request_async(method, path, options = {})
|
105
|
+
fail ArgumentError, 'method is nil' if method.nil?
|
106
|
+
fail ArgumentError, 'path is nil' if path.nil?
|
107
|
+
|
108
|
+
request_url = options[:base_url] || @base_url
|
109
|
+
|
110
|
+
request_headers = @request_headers
|
111
|
+
request_headers.merge!({'accept-language' => @accept_language}) unless @accept_language.nil?
|
112
|
+
options.merge!({headers: request_headers.merge(options[:headers] || {})})
|
113
|
+
options.merge!({credentials: @credentials}) unless @credentials.nil?
|
114
|
+
|
115
|
+
super(request_url, method, path, options)
|
116
|
+
end
|
117
|
+
|
118
|
+
|
119
|
+
private
|
120
|
+
#
|
121
|
+
# Adds telemetry information.
|
122
|
+
#
|
123
|
+
def add_telemetry
|
124
|
+
sdk_information = 'azure_mgmt_redis'
|
125
|
+
if defined? Azure::Redis::Mgmt::V2015_08_01::VERSION
|
126
|
+
sdk_information = "#{sdk_information}/#{Azure::Redis::Mgmt::V2015_08_01::VERSION}"
|
127
|
+
end
|
128
|
+
add_user_agent_information(sdk_information)
|
129
|
+
end
|
130
|
+
end
|
131
|
+
end
|
@@ -0,0 +1,56 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
# Code generated by Microsoft (R) AutoRest Code Generator.
|
3
|
+
# Changes may cause incorrect behavior and will be lost if the code is
|
4
|
+
# regenerated.
|
5
|
+
|
6
|
+
require 'uri'
|
7
|
+
require 'cgi'
|
8
|
+
require 'date'
|
9
|
+
require 'json'
|
10
|
+
require 'base64'
|
11
|
+
require 'erb'
|
12
|
+
require 'securerandom'
|
13
|
+
require 'time'
|
14
|
+
require 'timeliness'
|
15
|
+
require 'faraday'
|
16
|
+
require 'faraday-cookie_jar'
|
17
|
+
require 'concurrent'
|
18
|
+
require 'ms_rest'
|
19
|
+
require '2016-04-01/generated/azure_mgmt_redis/module_definition'
|
20
|
+
require 'ms_rest_azure'
|
21
|
+
|
22
|
+
module Azure::Redis::Mgmt::V2016_04_01
|
23
|
+
autoload :Operations, '2016-04-01/generated/azure_mgmt_redis/operations.rb'
|
24
|
+
autoload :Redis, '2016-04-01/generated/azure_mgmt_redis/redis.rb'
|
25
|
+
autoload :FirewallRules, '2016-04-01/generated/azure_mgmt_redis/firewall_rules.rb'
|
26
|
+
autoload :RedisFirewallRuleOperations, '2016-04-01/generated/azure_mgmt_redis/redis_firewall_rule_operations.rb'
|
27
|
+
autoload :PatchSchedules, '2016-04-01/generated/azure_mgmt_redis/patch_schedules.rb'
|
28
|
+
autoload :RedisManagementClient, '2016-04-01/generated/azure_mgmt_redis/redis_management_client.rb'
|
29
|
+
|
30
|
+
module Models
|
31
|
+
autoload :RedisRegenerateKeyParameters, '2016-04-01/generated/azure_mgmt_redis/models/redis_regenerate_key_parameters.rb'
|
32
|
+
autoload :Sku, '2016-04-01/generated/azure_mgmt_redis/models/sku.rb'
|
33
|
+
autoload :RedisRebootParameters, '2016-04-01/generated/azure_mgmt_redis/models/redis_reboot_parameters.rb'
|
34
|
+
autoload :Resource, '2016-04-01/generated/azure_mgmt_redis/models/resource.rb'
|
35
|
+
autoload :ExportRDBParameters, '2016-04-01/generated/azure_mgmt_redis/models/export_rdbparameters.rb'
|
36
|
+
autoload :RedisUpdateParameters, '2016-04-01/generated/azure_mgmt_redis/models/redis_update_parameters.rb'
|
37
|
+
autoload :ImportRDBParameters, '2016-04-01/generated/azure_mgmt_redis/models/import_rdbparameters.rb'
|
38
|
+
autoload :RedisFirewallRule, '2016-04-01/generated/azure_mgmt_redis/models/redis_firewall_rule.rb'
|
39
|
+
autoload :ScheduleEntry, '2016-04-01/generated/azure_mgmt_redis/models/schedule_entry.rb'
|
40
|
+
autoload :RedisListResult, '2016-04-01/generated/azure_mgmt_redis/models/redis_list_result.rb'
|
41
|
+
autoload :RedisPatchSchedule, '2016-04-01/generated/azure_mgmt_redis/models/redis_patch_schedule.rb'
|
42
|
+
autoload :OperationListResult, '2016-04-01/generated/azure_mgmt_redis/models/operation_list_result.rb'
|
43
|
+
autoload :RedisAccessKeys, '2016-04-01/generated/azure_mgmt_redis/models/redis_access_keys.rb'
|
44
|
+
autoload :RedisForceRebootResponse, '2016-04-01/generated/azure_mgmt_redis/models/redis_force_reboot_response.rb'
|
45
|
+
autoload :OperationDisplay, '2016-04-01/generated/azure_mgmt_redis/models/operation_display.rb'
|
46
|
+
autoload :RedisFirewallRuleListResult, '2016-04-01/generated/azure_mgmt_redis/models/redis_firewall_rule_list_result.rb'
|
47
|
+
autoload :Operation, '2016-04-01/generated/azure_mgmt_redis/models/operation.rb'
|
48
|
+
autoload :RedisCreateParameters, '2016-04-01/generated/azure_mgmt_redis/models/redis_create_parameters.rb'
|
49
|
+
autoload :RedisResource, '2016-04-01/generated/azure_mgmt_redis/models/redis_resource.rb'
|
50
|
+
autoload :SkuName, '2016-04-01/generated/azure_mgmt_redis/models/sku_name.rb'
|
51
|
+
autoload :SkuFamily, '2016-04-01/generated/azure_mgmt_redis/models/sku_family.rb'
|
52
|
+
autoload :RedisKeyType, '2016-04-01/generated/azure_mgmt_redis/models/redis_key_type.rb'
|
53
|
+
autoload :RebootType, '2016-04-01/generated/azure_mgmt_redis/models/reboot_type.rb'
|
54
|
+
autoload :DayOfWeek, '2016-04-01/generated/azure_mgmt_redis/models/day_of_week.rb'
|
55
|
+
end
|
56
|
+
end
|
@@ -0,0 +1,225 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
# Code generated by Microsoft (R) AutoRest Code Generator.
|
3
|
+
# Changes may cause incorrect behavior and will be lost if the code is
|
4
|
+
# regenerated.
|
5
|
+
|
6
|
+
module Azure::Redis::Mgmt::V2016_04_01
|
7
|
+
#
|
8
|
+
# REST API for Azure Redis Cache Service.
|
9
|
+
#
|
10
|
+
class FirewallRules
|
11
|
+
include MsRestAzure
|
12
|
+
|
13
|
+
#
|
14
|
+
# Creates and initializes a new instance of the FirewallRules class.
|
15
|
+
# @param client service class for accessing basic functionality.
|
16
|
+
#
|
17
|
+
def initialize(client)
|
18
|
+
@client = client
|
19
|
+
end
|
20
|
+
|
21
|
+
# @return [RedisManagementClient] reference to the RedisManagementClient
|
22
|
+
attr_reader :client
|
23
|
+
|
24
|
+
#
|
25
|
+
# Gets all firewall rules in the specified redis cache.
|
26
|
+
#
|
27
|
+
# @param resource_group_name [String] The name of the resource group.
|
28
|
+
# @param cache_name [String] The name of the Redis cache.
|
29
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
30
|
+
# will be added to the HTTP request.
|
31
|
+
#
|
32
|
+
# @return [Array<RedisFirewallRule>] operation results.
|
33
|
+
#
|
34
|
+
def list(resource_group_name, cache_name, custom_headers = nil)
|
35
|
+
first_page = list_as_lazy(resource_group_name, cache_name, custom_headers)
|
36
|
+
first_page.get_all_items
|
37
|
+
end
|
38
|
+
|
39
|
+
#
|
40
|
+
# Gets all firewall rules in the specified redis cache.
|
41
|
+
#
|
42
|
+
# @param resource_group_name [String] The name of the resource group.
|
43
|
+
# @param cache_name [String] The name of the Redis cache.
|
44
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
45
|
+
# will be added to the HTTP request.
|
46
|
+
#
|
47
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
48
|
+
#
|
49
|
+
def list_with_http_info(resource_group_name, cache_name, custom_headers = nil)
|
50
|
+
list_async(resource_group_name, cache_name, custom_headers).value!
|
51
|
+
end
|
52
|
+
|
53
|
+
#
|
54
|
+
# Gets all firewall rules in the specified redis cache.
|
55
|
+
#
|
56
|
+
# @param resource_group_name [String] The name of the resource group.
|
57
|
+
# @param cache_name [String] The name of the Redis cache.
|
58
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
59
|
+
# to the HTTP request.
|
60
|
+
#
|
61
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
62
|
+
#
|
63
|
+
def list_async(resource_group_name, cache_name, custom_headers = nil)
|
64
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
65
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
66
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
67
|
+
fail ArgumentError, 'cache_name is nil' if cache_name.nil?
|
68
|
+
|
69
|
+
|
70
|
+
request_headers = {}
|
71
|
+
|
72
|
+
# Set Headers
|
73
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
74
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
75
|
+
path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/{cacheName}/firewallRules'
|
76
|
+
|
77
|
+
request_url = @base_url || @client.base_url
|
78
|
+
|
79
|
+
options = {
|
80
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
81
|
+
path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'cacheName' => cache_name},
|
82
|
+
query_params: {'api-version' => @client.api_version},
|
83
|
+
headers: request_headers.merge(custom_headers || {}),
|
84
|
+
base_url: request_url
|
85
|
+
}
|
86
|
+
promise = @client.make_request_async(:get, path_template, options)
|
87
|
+
|
88
|
+
promise = promise.then do |result|
|
89
|
+
http_response = result.response
|
90
|
+
status_code = http_response.status
|
91
|
+
response_content = http_response.body
|
92
|
+
unless status_code == 200
|
93
|
+
error_model = JSON.load(response_content)
|
94
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
95
|
+
end
|
96
|
+
|
97
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
98
|
+
# Deserialize Response
|
99
|
+
if status_code == 200
|
100
|
+
begin
|
101
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
102
|
+
result_mapper = Azure::Redis::Mgmt::V2016_04_01::Models::RedisFirewallRuleListResult.mapper()
|
103
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
104
|
+
rescue Exception => e
|
105
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
106
|
+
end
|
107
|
+
end
|
108
|
+
|
109
|
+
result
|
110
|
+
end
|
111
|
+
|
112
|
+
promise.execute
|
113
|
+
end
|
114
|
+
|
115
|
+
#
|
116
|
+
# Gets all firewall rules in the specified redis cache.
|
117
|
+
#
|
118
|
+
# @param next_page_link [String] The NextLink from the previous successful call
|
119
|
+
# to List operation.
|
120
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
121
|
+
# will be added to the HTTP request.
|
122
|
+
#
|
123
|
+
# @return [RedisFirewallRuleListResult] operation results.
|
124
|
+
#
|
125
|
+
def list_next(next_page_link, custom_headers = nil)
|
126
|
+
response = list_next_async(next_page_link, custom_headers).value!
|
127
|
+
response.body unless response.nil?
|
128
|
+
end
|
129
|
+
|
130
|
+
#
|
131
|
+
# Gets all firewall rules in the specified redis cache.
|
132
|
+
#
|
133
|
+
# @param next_page_link [String] The NextLink from the previous successful call
|
134
|
+
# to List operation.
|
135
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
136
|
+
# will be added to the HTTP request.
|
137
|
+
#
|
138
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
139
|
+
#
|
140
|
+
def list_next_with_http_info(next_page_link, custom_headers = nil)
|
141
|
+
list_next_async(next_page_link, custom_headers).value!
|
142
|
+
end
|
143
|
+
|
144
|
+
#
|
145
|
+
# Gets all firewall rules in the specified redis cache.
|
146
|
+
#
|
147
|
+
# @param next_page_link [String] The NextLink from the previous successful call
|
148
|
+
# to List operation.
|
149
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
150
|
+
# to the HTTP request.
|
151
|
+
#
|
152
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
153
|
+
#
|
154
|
+
def list_next_async(next_page_link, custom_headers = nil)
|
155
|
+
fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
|
156
|
+
|
157
|
+
|
158
|
+
request_headers = {}
|
159
|
+
|
160
|
+
# Set Headers
|
161
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
162
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
163
|
+
path_template = '{nextLink}'
|
164
|
+
|
165
|
+
request_url = @base_url || @client.base_url
|
166
|
+
|
167
|
+
options = {
|
168
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
169
|
+
skip_encoding_path_params: {'nextLink' => next_page_link},
|
170
|
+
headers: request_headers.merge(custom_headers || {}),
|
171
|
+
base_url: request_url
|
172
|
+
}
|
173
|
+
promise = @client.make_request_async(:get, path_template, options)
|
174
|
+
|
175
|
+
promise = promise.then do |result|
|
176
|
+
http_response = result.response
|
177
|
+
status_code = http_response.status
|
178
|
+
response_content = http_response.body
|
179
|
+
unless status_code == 200
|
180
|
+
error_model = JSON.load(response_content)
|
181
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
182
|
+
end
|
183
|
+
|
184
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
185
|
+
# Deserialize Response
|
186
|
+
if status_code == 200
|
187
|
+
begin
|
188
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
189
|
+
result_mapper = Azure::Redis::Mgmt::V2016_04_01::Models::RedisFirewallRuleListResult.mapper()
|
190
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
191
|
+
rescue Exception => e
|
192
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
193
|
+
end
|
194
|
+
end
|
195
|
+
|
196
|
+
result
|
197
|
+
end
|
198
|
+
|
199
|
+
promise.execute
|
200
|
+
end
|
201
|
+
|
202
|
+
#
|
203
|
+
# Gets all firewall rules in the specified redis cache.
|
204
|
+
#
|
205
|
+
# @param resource_group_name [String] The name of the resource group.
|
206
|
+
# @param cache_name [String] The name of the Redis cache.
|
207
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
208
|
+
# will be added to the HTTP request.
|
209
|
+
#
|
210
|
+
# @return [RedisFirewallRuleListResult] which provide lazy access to pages of
|
211
|
+
# the response.
|
212
|
+
#
|
213
|
+
def list_as_lazy(resource_group_name, cache_name, custom_headers = nil)
|
214
|
+
response = list_async(resource_group_name, cache_name, custom_headers).value!
|
215
|
+
unless response.nil?
|
216
|
+
page = response.body
|
217
|
+
page.next_method = Proc.new do |next_page_link|
|
218
|
+
list_next_async(next_page_link, custom_headers)
|
219
|
+
end
|
220
|
+
page
|
221
|
+
end
|
222
|
+
end
|
223
|
+
|
224
|
+
end
|
225
|
+
end
|