azure_mgmt_storagecache 0.18.1 → 0.19.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/2019-08-01-preview/generated/azure_mgmt_storagecache/storage_cache_management_client.rb +1 -1
- data/lib/2019-11-01/generated/azure_mgmt_storagecache/storage_cache_management_client.rb +1 -1
- data/lib/2020-03-01/generated/azure_mgmt_storagecache/storage_cache_management_client.rb +1 -1
- data/lib/2020-10-01/generated/azure_mgmt_storagecache.rb +92 -0
- data/lib/2020-10-01/generated/azure_mgmt_storagecache/asc_operations.rb +127 -0
- data/lib/2020-10-01/generated/azure_mgmt_storagecache/caches.rb +1580 -0
- data/lib/2020-10-01/generated/azure_mgmt_storagecache/models/api_operation.rb +95 -0
- data/lib/2020-10-01/generated/azure_mgmt_storagecache/models/api_operation_display.rb +80 -0
- data/lib/2020-10-01/generated/azure_mgmt_storagecache/models/api_operation_list_result.rb +101 -0
- data/lib/2020-10-01/generated/azure_mgmt_storagecache/models/api_operation_properties_service_specification.rb +57 -0
- data/lib/2020-10-01/generated/azure_mgmt_storagecache/models/asc_operation.rb +121 -0
- data/lib/2020-10-01/generated/azure_mgmt_storagecache/models/cache.rb +264 -0
- data/lib/2020-10-01/generated/azure_mgmt_storagecache/models/cache_active_directory_settings.rb +124 -0
- data/lib/2020-10-01/generated/azure_mgmt_storagecache/models/cache_active_directory_settings_credentials.rb +61 -0
- data/lib/2020-10-01/generated/azure_mgmt_storagecache/models/cache_directory_settings.rb +62 -0
- data/lib/2020-10-01/generated/azure_mgmt_storagecache/models/cache_encryption_settings.rb +48 -0
- data/lib/2020-10-01/generated/azure_mgmt_storagecache/models/cache_health.rb +60 -0
- data/lib/2020-10-01/generated/azure_mgmt_storagecache/models/cache_identity.rb +72 -0
- data/lib/2020-10-01/generated/azure_mgmt_storagecache/models/cache_identity_type.rb +16 -0
- data/lib/2020-10-01/generated/azure_mgmt_storagecache/models/cache_network_settings.rb +73 -0
- data/lib/2020-10-01/generated/azure_mgmt_storagecache/models/cache_security_settings.rb +56 -0
- data/lib/2020-10-01/generated/azure_mgmt_storagecache/models/cache_sku.rb +46 -0
- data/lib/2020-10-01/generated/azure_mgmt_storagecache/models/cache_upgrade_status.rb +101 -0
- data/lib/2020-10-01/generated/azure_mgmt_storagecache/models/cache_username_download_settings.rb +186 -0
- data/lib/2020-10-01/generated/azure_mgmt_storagecache/models/cache_username_download_settings_credentials.rb +61 -0
- data/lib/2020-10-01/generated/azure_mgmt_storagecache/models/caches_list_result.rb +100 -0
- data/lib/2020-10-01/generated/azure_mgmt_storagecache/models/clfs_target.rb +46 -0
- data/lib/2020-10-01/generated/azure_mgmt_storagecache/models/clfs_target_properties.rb +102 -0
- data/lib/2020-10-01/generated/azure_mgmt_storagecache/models/cloud_error_body.rb +92 -0
- data/lib/2020-10-01/generated/azure_mgmt_storagecache/models/created_by_type.rb +18 -0
- data/lib/2020-10-01/generated/azure_mgmt_storagecache/models/domain_joined_type.rb +17 -0
- data/lib/2020-10-01/generated/azure_mgmt_storagecache/models/error_response.rb +57 -0
- data/lib/2020-10-01/generated/azure_mgmt_storagecache/models/firmware_status_type.rb +16 -0
- data/lib/2020-10-01/generated/azure_mgmt_storagecache/models/health_state_type.rb +23 -0
- data/lib/2020-10-01/generated/azure_mgmt_storagecache/models/key_vault_key_reference.rb +59 -0
- data/lib/2020-10-01/generated/azure_mgmt_storagecache/models/key_vault_key_reference_source_vault.rb +46 -0
- data/lib/2020-10-01/generated/azure_mgmt_storagecache/models/metric_aggregation_type.rb +21 -0
- data/lib/2020-10-01/generated/azure_mgmt_storagecache/models/metric_dimension.rb +79 -0
- data/lib/2020-10-01/generated/azure_mgmt_storagecache/models/metric_specification.rb +140 -0
- data/lib/2020-10-01/generated/azure_mgmt_storagecache/models/namespace_junction.rb +79 -0
- data/lib/2020-10-01/generated/azure_mgmt_storagecache/models/nfs3target.rb +62 -0
- data/lib/2020-10-01/generated/azure_mgmt_storagecache/models/nfs3target_properties.rb +102 -0
- data/lib/2020-10-01/generated/azure_mgmt_storagecache/models/nfs_access_policy.rb +69 -0
- data/lib/2020-10-01/generated/azure_mgmt_storagecache/models/nfs_access_rule.rb +139 -0
- data/lib/2020-10-01/generated/azure_mgmt_storagecache/models/nfs_access_rule_access.rb +17 -0
- data/lib/2020-10-01/generated/azure_mgmt_storagecache/models/nfs_access_rule_scope.rb +17 -0
- data/lib/2020-10-01/generated/azure_mgmt_storagecache/models/provisioning_state_type.rb +20 -0
- data/lib/2020-10-01/generated/azure_mgmt_storagecache/models/reason_code.rb +16 -0
- data/lib/2020-10-01/generated/azure_mgmt_storagecache/models/resource_sku.rb +143 -0
- data/lib/2020-10-01/generated/azure_mgmt_storagecache/models/resource_sku_capabilities.rb +57 -0
- data/lib/2020-10-01/generated/azure_mgmt_storagecache/models/resource_sku_location_info.rb +65 -0
- data/lib/2020-10-01/generated/azure_mgmt_storagecache/models/resource_skus_result.rb +100 -0
- data/lib/2020-10-01/generated/azure_mgmt_storagecache/models/restriction.rb +86 -0
- data/lib/2020-10-01/generated/azure_mgmt_storagecache/models/storage_target.rb +163 -0
- data/lib/2020-10-01/generated/azure_mgmt_storagecache/models/storage_target_properties.rb +119 -0
- data/lib/2020-10-01/generated/azure_mgmt_storagecache/models/storage_target_resource.rb +97 -0
- data/lib/2020-10-01/generated/azure_mgmt_storagecache/models/storage_targets_result.rb +99 -0
- data/lib/2020-10-01/generated/azure_mgmt_storagecache/models/system_data.rb +106 -0
- data/lib/2020-10-01/generated/azure_mgmt_storagecache/models/unknown_target.rb +55 -0
- data/lib/2020-10-01/generated/azure_mgmt_storagecache/models/unknown_target_properties.rb +102 -0
- data/lib/2020-10-01/generated/azure_mgmt_storagecache/models/usage_model.rb +71 -0
- data/lib/2020-10-01/generated/azure_mgmt_storagecache/models/usage_model_display.rb +46 -0
- data/lib/2020-10-01/generated/azure_mgmt_storagecache/models/usage_models_result.rb +99 -0
- data/lib/2020-10-01/generated/azure_mgmt_storagecache/models/username_downloaded_type.rb +17 -0
- data/lib/2020-10-01/generated/azure_mgmt_storagecache/models/username_source.rb +18 -0
- data/lib/2020-10-01/generated/azure_mgmt_storagecache/module_definition.rb +9 -0
- data/lib/2020-10-01/generated/azure_mgmt_storagecache/operations.rb +221 -0
- data/lib/2020-10-01/generated/azure_mgmt_storagecache/skus.rb +223 -0
- data/lib/2020-10-01/generated/azure_mgmt_storagecache/storage_cache_management_client.rb +157 -0
- data/lib/2020-10-01/generated/azure_mgmt_storagecache/storage_targets.rb +691 -0
- data/lib/2020-10-01/generated/azure_mgmt_storagecache/usage_models.rb +223 -0
- data/lib/azure_mgmt_storagecache.rb +2 -1
- data/lib/profiles/latest/modules/storagecache_profile_module.rb +182 -104
- data/lib/version.rb +1 -1
- metadata +71 -3
@@ -0,0 +1,99 @@
|
|
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::StorageCache::Mgmt::V2020_10_01
|
7
|
+
module Models
|
8
|
+
#
|
9
|
+
# A list of Cache usage models.
|
10
|
+
#
|
11
|
+
class UsageModelsResult
|
12
|
+
|
13
|
+
include MsRestAzure
|
14
|
+
|
15
|
+
include MsRest::JSONable
|
16
|
+
# @return [String] The URI to fetch the next page of Cache usage models.
|
17
|
+
attr_accessor :next_link
|
18
|
+
|
19
|
+
# @return [Array<UsageModel>] The list of usage models available for the
|
20
|
+
# subscription.
|
21
|
+
attr_accessor :value
|
22
|
+
|
23
|
+
# return [Proc] with next page method call.
|
24
|
+
attr_accessor :next_method
|
25
|
+
|
26
|
+
#
|
27
|
+
# Gets the rest of the items for the request, enabling auto-pagination.
|
28
|
+
#
|
29
|
+
# @return [Array<UsageModel>] operation results.
|
30
|
+
#
|
31
|
+
def get_all_items
|
32
|
+
items = @value
|
33
|
+
page = self
|
34
|
+
while page.next_link != nil && !page.next_link.strip.empty? do
|
35
|
+
page = page.get_next_page
|
36
|
+
items.concat(page.value)
|
37
|
+
end
|
38
|
+
items
|
39
|
+
end
|
40
|
+
|
41
|
+
#
|
42
|
+
# Gets the next page of results.
|
43
|
+
#
|
44
|
+
# @return [UsageModelsResult] with next page content.
|
45
|
+
#
|
46
|
+
def get_next_page
|
47
|
+
response = @next_method.call(@next_link).value! unless @next_method.nil?
|
48
|
+
unless response.nil?
|
49
|
+
@next_link = response.body.next_link
|
50
|
+
@value = response.body.value
|
51
|
+
self
|
52
|
+
end
|
53
|
+
end
|
54
|
+
|
55
|
+
#
|
56
|
+
# Mapper for UsageModelsResult class as Ruby Hash.
|
57
|
+
# This will be used for serialization/deserialization.
|
58
|
+
#
|
59
|
+
def self.mapper()
|
60
|
+
{
|
61
|
+
client_side_validation: true,
|
62
|
+
required: false,
|
63
|
+
serialized_name: 'UsageModelsResult',
|
64
|
+
type: {
|
65
|
+
name: 'Composite',
|
66
|
+
class_name: 'UsageModelsResult',
|
67
|
+
model_properties: {
|
68
|
+
next_link: {
|
69
|
+
client_side_validation: true,
|
70
|
+
required: false,
|
71
|
+
serialized_name: 'nextLink',
|
72
|
+
type: {
|
73
|
+
name: 'String'
|
74
|
+
}
|
75
|
+
},
|
76
|
+
value: {
|
77
|
+
client_side_validation: true,
|
78
|
+
required: false,
|
79
|
+
serialized_name: 'value',
|
80
|
+
type: {
|
81
|
+
name: 'Sequence',
|
82
|
+
element: {
|
83
|
+
client_side_validation: true,
|
84
|
+
required: false,
|
85
|
+
serialized_name: 'UsageModelElementType',
|
86
|
+
type: {
|
87
|
+
name: 'Composite',
|
88
|
+
class_name: 'UsageModel'
|
89
|
+
}
|
90
|
+
}
|
91
|
+
}
|
92
|
+
}
|
93
|
+
}
|
94
|
+
}
|
95
|
+
}
|
96
|
+
end
|
97
|
+
end
|
98
|
+
end
|
99
|
+
end
|
@@ -0,0 +1,17 @@
|
|
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::StorageCache::Mgmt::V2020_10_01
|
7
|
+
module Models
|
8
|
+
#
|
9
|
+
# Defines values for UsernameDownloadedType
|
10
|
+
#
|
11
|
+
module UsernameDownloadedType
|
12
|
+
Yes = "Yes"
|
13
|
+
No = "No"
|
14
|
+
Error = "Error"
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,18 @@
|
|
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::StorageCache::Mgmt::V2020_10_01
|
7
|
+
module Models
|
8
|
+
#
|
9
|
+
# Defines values for UsernameSource
|
10
|
+
#
|
11
|
+
module UsernameSource
|
12
|
+
AD = "AD"
|
13
|
+
LDAP = "LDAP"
|
14
|
+
File = "File"
|
15
|
+
None = "None"
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1,9 @@
|
|
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 end
|
7
|
+
module Azure::StorageCache end
|
8
|
+
module Azure::StorageCache::Mgmt end
|
9
|
+
module Azure::StorageCache::Mgmt::V2020_10_01 end
|
@@ -0,0 +1,221 @@
|
|
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::StorageCache::Mgmt::V2020_10_01
|
7
|
+
#
|
8
|
+
# A Storage Cache provides scalable caching service for NAS clients, serving
|
9
|
+
# data from either NFSv3 or Blob at-rest storage (referred to as "Storage
|
10
|
+
# Targets"). These operations allow you to manage Caches.
|
11
|
+
#
|
12
|
+
class Operations
|
13
|
+
include MsRestAzure
|
14
|
+
|
15
|
+
#
|
16
|
+
# Creates and initializes a new instance of the Operations class.
|
17
|
+
# @param client service class for accessing basic functionality.
|
18
|
+
#
|
19
|
+
def initialize(client)
|
20
|
+
@client = client
|
21
|
+
end
|
22
|
+
|
23
|
+
# @return [StorageCacheManagementClient] reference to the StorageCacheManagementClient
|
24
|
+
attr_reader :client
|
25
|
+
|
26
|
+
#
|
27
|
+
# Lists all of the available Resource Provider operations.
|
28
|
+
#
|
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<ApiOperation>] operation results.
|
33
|
+
#
|
34
|
+
def list(custom_headers:nil)
|
35
|
+
first_page = list_as_lazy(custom_headers:custom_headers)
|
36
|
+
first_page.get_all_items
|
37
|
+
end
|
38
|
+
|
39
|
+
#
|
40
|
+
# Lists all of the available Resource Provider operations.
|
41
|
+
#
|
42
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
43
|
+
# will be added to the HTTP request.
|
44
|
+
#
|
45
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
46
|
+
#
|
47
|
+
def list_with_http_info(custom_headers:nil)
|
48
|
+
list_async(custom_headers:custom_headers).value!
|
49
|
+
end
|
50
|
+
|
51
|
+
#
|
52
|
+
# Lists all of the available Resource Provider operations.
|
53
|
+
#
|
54
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
55
|
+
# to the HTTP request.
|
56
|
+
#
|
57
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
58
|
+
#
|
59
|
+
def list_async(custom_headers:nil)
|
60
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
61
|
+
|
62
|
+
|
63
|
+
request_headers = {}
|
64
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
65
|
+
|
66
|
+
# Set Headers
|
67
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
68
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
69
|
+
path_template = 'providers/Microsoft.StorageCache/operations'
|
70
|
+
|
71
|
+
request_url = @base_url || @client.base_url
|
72
|
+
|
73
|
+
options = {
|
74
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
75
|
+
query_params: {'api-version' => @client.api_version},
|
76
|
+
headers: request_headers.merge(custom_headers || {}),
|
77
|
+
base_url: request_url
|
78
|
+
}
|
79
|
+
promise = @client.make_request_async(:get, path_template, options)
|
80
|
+
|
81
|
+
promise = promise.then do |result|
|
82
|
+
http_response = result.response
|
83
|
+
status_code = http_response.status
|
84
|
+
response_content = http_response.body
|
85
|
+
unless status_code == 200
|
86
|
+
error_model = JSON.load(response_content)
|
87
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
88
|
+
end
|
89
|
+
|
90
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
91
|
+
result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
|
92
|
+
result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
|
93
|
+
# Deserialize Response
|
94
|
+
if status_code == 200
|
95
|
+
begin
|
96
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
97
|
+
result_mapper = Azure::StorageCache::Mgmt::V2020_10_01::Models::ApiOperationListResult.mapper()
|
98
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
99
|
+
rescue Exception => e
|
100
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
101
|
+
end
|
102
|
+
end
|
103
|
+
|
104
|
+
result
|
105
|
+
end
|
106
|
+
|
107
|
+
promise.execute
|
108
|
+
end
|
109
|
+
|
110
|
+
#
|
111
|
+
# Lists all of the available Resource Provider operations.
|
112
|
+
#
|
113
|
+
# @param next_page_link [String] The NextLink from the previous successful call
|
114
|
+
# to List operation.
|
115
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
116
|
+
# will be added to the HTTP request.
|
117
|
+
#
|
118
|
+
# @return [ApiOperationListResult] operation results.
|
119
|
+
#
|
120
|
+
def list_next(next_page_link, custom_headers:nil)
|
121
|
+
response = list_next_async(next_page_link, custom_headers:custom_headers).value!
|
122
|
+
response.body unless response.nil?
|
123
|
+
end
|
124
|
+
|
125
|
+
#
|
126
|
+
# Lists all of the available Resource Provider operations.
|
127
|
+
#
|
128
|
+
# @param next_page_link [String] The NextLink from the previous successful call
|
129
|
+
# to List operation.
|
130
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
131
|
+
# will be added to the HTTP request.
|
132
|
+
#
|
133
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
134
|
+
#
|
135
|
+
def list_next_with_http_info(next_page_link, custom_headers:nil)
|
136
|
+
list_next_async(next_page_link, custom_headers:custom_headers).value!
|
137
|
+
end
|
138
|
+
|
139
|
+
#
|
140
|
+
# Lists all of the available Resource Provider operations.
|
141
|
+
#
|
142
|
+
# @param next_page_link [String] The NextLink from the previous successful call
|
143
|
+
# to List operation.
|
144
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
145
|
+
# to the HTTP request.
|
146
|
+
#
|
147
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
148
|
+
#
|
149
|
+
def list_next_async(next_page_link, custom_headers:nil)
|
150
|
+
fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
|
151
|
+
|
152
|
+
|
153
|
+
request_headers = {}
|
154
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
155
|
+
|
156
|
+
# Set Headers
|
157
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
158
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
159
|
+
path_template = '{nextLink}'
|
160
|
+
|
161
|
+
request_url = @base_url || @client.base_url
|
162
|
+
|
163
|
+
options = {
|
164
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
165
|
+
skip_encoding_path_params: {'nextLink' => next_page_link},
|
166
|
+
headers: request_headers.merge(custom_headers || {}),
|
167
|
+
base_url: request_url
|
168
|
+
}
|
169
|
+
promise = @client.make_request_async(:get, path_template, options)
|
170
|
+
|
171
|
+
promise = promise.then do |result|
|
172
|
+
http_response = result.response
|
173
|
+
status_code = http_response.status
|
174
|
+
response_content = http_response.body
|
175
|
+
unless status_code == 200
|
176
|
+
error_model = JSON.load(response_content)
|
177
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
178
|
+
end
|
179
|
+
|
180
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
181
|
+
result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
|
182
|
+
result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
|
183
|
+
# Deserialize Response
|
184
|
+
if status_code == 200
|
185
|
+
begin
|
186
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
187
|
+
result_mapper = Azure::StorageCache::Mgmt::V2020_10_01::Models::ApiOperationListResult.mapper()
|
188
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
189
|
+
rescue Exception => e
|
190
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
191
|
+
end
|
192
|
+
end
|
193
|
+
|
194
|
+
result
|
195
|
+
end
|
196
|
+
|
197
|
+
promise.execute
|
198
|
+
end
|
199
|
+
|
200
|
+
#
|
201
|
+
# Lists all of the available Resource Provider operations.
|
202
|
+
#
|
203
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
204
|
+
# will be added to the HTTP request.
|
205
|
+
#
|
206
|
+
# @return [ApiOperationListResult] which provide lazy access to pages of the
|
207
|
+
# response.
|
208
|
+
#
|
209
|
+
def list_as_lazy(custom_headers:nil)
|
210
|
+
response = list_async(custom_headers:custom_headers).value!
|
211
|
+
unless response.nil?
|
212
|
+
page = response.body
|
213
|
+
page.next_method = Proc.new do |next_page_link|
|
214
|
+
list_next_async(next_page_link, custom_headers:custom_headers)
|
215
|
+
end
|
216
|
+
page
|
217
|
+
end
|
218
|
+
end
|
219
|
+
|
220
|
+
end
|
221
|
+
end
|
@@ -0,0 +1,223 @@
|
|
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::StorageCache::Mgmt::V2020_10_01
|
7
|
+
#
|
8
|
+
# A Storage Cache provides scalable caching service for NAS clients, serving
|
9
|
+
# data from either NFSv3 or Blob at-rest storage (referred to as "Storage
|
10
|
+
# Targets"). These operations allow you to manage Caches.
|
11
|
+
#
|
12
|
+
class Skus
|
13
|
+
include MsRestAzure
|
14
|
+
|
15
|
+
#
|
16
|
+
# Creates and initializes a new instance of the Skus class.
|
17
|
+
# @param client service class for accessing basic functionality.
|
18
|
+
#
|
19
|
+
def initialize(client)
|
20
|
+
@client = client
|
21
|
+
end
|
22
|
+
|
23
|
+
# @return [StorageCacheManagementClient] reference to the StorageCacheManagementClient
|
24
|
+
attr_reader :client
|
25
|
+
|
26
|
+
#
|
27
|
+
# Get the list of StorageCache.Cache SKUs available to this subscription.
|
28
|
+
#
|
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<ResourceSku>] operation results.
|
33
|
+
#
|
34
|
+
def list(custom_headers:nil)
|
35
|
+
first_page = list_as_lazy(custom_headers:custom_headers)
|
36
|
+
first_page.get_all_items
|
37
|
+
end
|
38
|
+
|
39
|
+
#
|
40
|
+
# Get the list of StorageCache.Cache SKUs available to this subscription.
|
41
|
+
#
|
42
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
43
|
+
# will be added to the HTTP request.
|
44
|
+
#
|
45
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
46
|
+
#
|
47
|
+
def list_with_http_info(custom_headers:nil)
|
48
|
+
list_async(custom_headers:custom_headers).value!
|
49
|
+
end
|
50
|
+
|
51
|
+
#
|
52
|
+
# Get the list of StorageCache.Cache SKUs available to this subscription.
|
53
|
+
#
|
54
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
55
|
+
# to the HTTP request.
|
56
|
+
#
|
57
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
58
|
+
#
|
59
|
+
def list_async(custom_headers:nil)
|
60
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
61
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
62
|
+
|
63
|
+
|
64
|
+
request_headers = {}
|
65
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
66
|
+
|
67
|
+
# Set Headers
|
68
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
69
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
70
|
+
path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.StorageCache/skus'
|
71
|
+
|
72
|
+
request_url = @base_url || @client.base_url
|
73
|
+
|
74
|
+
options = {
|
75
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
76
|
+
path_params: {'subscriptionId' => @client.subscription_id},
|
77
|
+
query_params: {'api-version' => @client.api_version},
|
78
|
+
headers: request_headers.merge(custom_headers || {}),
|
79
|
+
base_url: request_url
|
80
|
+
}
|
81
|
+
promise = @client.make_request_async(:get, path_template, options)
|
82
|
+
|
83
|
+
promise = promise.then do |result|
|
84
|
+
http_response = result.response
|
85
|
+
status_code = http_response.status
|
86
|
+
response_content = http_response.body
|
87
|
+
unless status_code == 200
|
88
|
+
error_model = JSON.load(response_content)
|
89
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
90
|
+
end
|
91
|
+
|
92
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
93
|
+
result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
|
94
|
+
result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
|
95
|
+
# Deserialize Response
|
96
|
+
if status_code == 200
|
97
|
+
begin
|
98
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
99
|
+
result_mapper = Azure::StorageCache::Mgmt::V2020_10_01::Models::ResourceSkusResult.mapper()
|
100
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
101
|
+
rescue Exception => e
|
102
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
103
|
+
end
|
104
|
+
end
|
105
|
+
|
106
|
+
result
|
107
|
+
end
|
108
|
+
|
109
|
+
promise.execute
|
110
|
+
end
|
111
|
+
|
112
|
+
#
|
113
|
+
# Get the list of StorageCache.Cache SKUs available to this subscription.
|
114
|
+
#
|
115
|
+
# @param next_page_link [String] The NextLink from the previous successful call
|
116
|
+
# to List operation.
|
117
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
118
|
+
# will be added to the HTTP request.
|
119
|
+
#
|
120
|
+
# @return [ResourceSkusResult] operation results.
|
121
|
+
#
|
122
|
+
def list_next(next_page_link, custom_headers:nil)
|
123
|
+
response = list_next_async(next_page_link, custom_headers:custom_headers).value!
|
124
|
+
response.body unless response.nil?
|
125
|
+
end
|
126
|
+
|
127
|
+
#
|
128
|
+
# Get the list of StorageCache.Cache SKUs available to this subscription.
|
129
|
+
#
|
130
|
+
# @param next_page_link [String] The NextLink from the previous successful call
|
131
|
+
# to List operation.
|
132
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
133
|
+
# will be added to the HTTP request.
|
134
|
+
#
|
135
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
136
|
+
#
|
137
|
+
def list_next_with_http_info(next_page_link, custom_headers:nil)
|
138
|
+
list_next_async(next_page_link, custom_headers:custom_headers).value!
|
139
|
+
end
|
140
|
+
|
141
|
+
#
|
142
|
+
# Get the list of StorageCache.Cache SKUs available to this subscription.
|
143
|
+
#
|
144
|
+
# @param next_page_link [String] The NextLink from the previous successful call
|
145
|
+
# to List operation.
|
146
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
147
|
+
# to the HTTP request.
|
148
|
+
#
|
149
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
150
|
+
#
|
151
|
+
def list_next_async(next_page_link, custom_headers:nil)
|
152
|
+
fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
|
153
|
+
|
154
|
+
|
155
|
+
request_headers = {}
|
156
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
157
|
+
|
158
|
+
# Set Headers
|
159
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
160
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
161
|
+
path_template = '{nextLink}'
|
162
|
+
|
163
|
+
request_url = @base_url || @client.base_url
|
164
|
+
|
165
|
+
options = {
|
166
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
167
|
+
skip_encoding_path_params: {'nextLink' => next_page_link},
|
168
|
+
headers: request_headers.merge(custom_headers || {}),
|
169
|
+
base_url: request_url
|
170
|
+
}
|
171
|
+
promise = @client.make_request_async(:get, path_template, options)
|
172
|
+
|
173
|
+
promise = promise.then do |result|
|
174
|
+
http_response = result.response
|
175
|
+
status_code = http_response.status
|
176
|
+
response_content = http_response.body
|
177
|
+
unless status_code == 200
|
178
|
+
error_model = JSON.load(response_content)
|
179
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
180
|
+
end
|
181
|
+
|
182
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
183
|
+
result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
|
184
|
+
result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-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::StorageCache::Mgmt::V2020_10_01::Models::ResourceSkusResult.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
|
+
# Get the list of StorageCache.Cache SKUs available to this subscription.
|
204
|
+
#
|
205
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
206
|
+
# will be added to the HTTP request.
|
207
|
+
#
|
208
|
+
# @return [ResourceSkusResult] which provide lazy access to pages of the
|
209
|
+
# response.
|
210
|
+
#
|
211
|
+
def list_as_lazy(custom_headers:nil)
|
212
|
+
response = list_async(custom_headers:custom_headers).value!
|
213
|
+
unless response.nil?
|
214
|
+
page = response.body
|
215
|
+
page.next_method = Proc.new do |next_page_link|
|
216
|
+
list_next_async(next_page_link, custom_headers:custom_headers)
|
217
|
+
end
|
218
|
+
page
|
219
|
+
end
|
220
|
+
end
|
221
|
+
|
222
|
+
end
|
223
|
+
end
|