azure_mgmt_key_vault 0.17.4 → 0.17.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/LICENSE.txt +20 -20
- data/lib/2015-06-01/generated/azure_mgmt_key_vault.rb +0 -0
- data/lib/2015-06-01/generated/azure_mgmt_key_vault/key_vault_management_client.rb +1 -1
- data/lib/2015-06-01/generated/azure_mgmt_key_vault/models/access_policy_entry.rb +0 -0
- data/lib/2015-06-01/generated/azure_mgmt_key_vault/models/certificate_permissions.rb +0 -0
- data/lib/2015-06-01/generated/azure_mgmt_key_vault/models/key_permissions.rb +0 -0
- data/lib/2015-06-01/generated/azure_mgmt_key_vault/models/permissions.rb +0 -0
- data/lib/2015-06-01/generated/azure_mgmt_key_vault/models/resource.rb +0 -0
- data/lib/2015-06-01/generated/azure_mgmt_key_vault/models/resource_list_result.rb +0 -0
- data/lib/2015-06-01/generated/azure_mgmt_key_vault/models/secret_permissions.rb +0 -0
- data/lib/2015-06-01/generated/azure_mgmt_key_vault/models/sku.rb +0 -0
- data/lib/2015-06-01/generated/azure_mgmt_key_vault/models/sku_name.rb +0 -0
- data/lib/2015-06-01/generated/azure_mgmt_key_vault/models/vault.rb +0 -0
- data/lib/2015-06-01/generated/azure_mgmt_key_vault/models/vault_create_or_update_parameters.rb +0 -0
- data/lib/2015-06-01/generated/azure_mgmt_key_vault/models/vault_list_result.rb +0 -0
- data/lib/2015-06-01/generated/azure_mgmt_key_vault/models/vault_properties.rb +0 -0
- data/lib/2015-06-01/generated/azure_mgmt_key_vault/module_definition.rb +0 -0
- data/lib/2015-06-01/generated/azure_mgmt_key_vault/vaults.rb +14 -0
- data/lib/2016-10-01/generated/azure_mgmt_key_vault.rb +0 -0
- data/lib/2016-10-01/generated/azure_mgmt_key_vault/key_vault_management_client.rb +1 -1
- data/lib/2016-10-01/generated/azure_mgmt_key_vault/models/access_policy_entry.rb +0 -0
- data/lib/2016-10-01/generated/azure_mgmt_key_vault/models/access_policy_update_kind.rb +0 -0
- data/lib/2016-10-01/generated/azure_mgmt_key_vault/models/certificate_permissions.rb +0 -0
- data/lib/2016-10-01/generated/azure_mgmt_key_vault/models/check_name_availability_result.rb +0 -0
- data/lib/2016-10-01/generated/azure_mgmt_key_vault/models/create_mode.rb +0 -0
- data/lib/2016-10-01/generated/azure_mgmt_key_vault/models/deleted_vault.rb +0 -0
- data/lib/2016-10-01/generated/azure_mgmt_key_vault/models/deleted_vault_list_result.rb +0 -0
- data/lib/2016-10-01/generated/azure_mgmt_key_vault/models/deleted_vault_properties.rb +0 -0
- data/lib/2016-10-01/generated/azure_mgmt_key_vault/models/key_permissions.rb +0 -0
- data/lib/2016-10-01/generated/azure_mgmt_key_vault/models/log_specification.rb +0 -0
- data/lib/2016-10-01/generated/azure_mgmt_key_vault/models/operation.rb +0 -0
- data/lib/2016-10-01/generated/azure_mgmt_key_vault/models/operation_display.rb +0 -0
- data/lib/2016-10-01/generated/azure_mgmt_key_vault/models/operation_list_result.rb +0 -0
- data/lib/2016-10-01/generated/azure_mgmt_key_vault/models/permissions.rb +0 -0
- data/lib/2016-10-01/generated/azure_mgmt_key_vault/models/reason.rb +0 -0
- data/lib/2016-10-01/generated/azure_mgmt_key_vault/models/resource.rb +0 -0
- data/lib/2016-10-01/generated/azure_mgmt_key_vault/models/resource_list_result.rb +0 -0
- data/lib/2016-10-01/generated/azure_mgmt_key_vault/models/secret_permissions.rb +0 -0
- data/lib/2016-10-01/generated/azure_mgmt_key_vault/models/service_specification.rb +0 -0
- data/lib/2016-10-01/generated/azure_mgmt_key_vault/models/sku.rb +0 -0
- data/lib/2016-10-01/generated/azure_mgmt_key_vault/models/sku_name.rb +0 -0
- data/lib/2016-10-01/generated/azure_mgmt_key_vault/models/storage_permissions.rb +0 -0
- data/lib/2016-10-01/generated/azure_mgmt_key_vault/models/vault.rb +0 -0
- data/lib/2016-10-01/generated/azure_mgmt_key_vault/models/vault_access_policy_parameters.rb +0 -0
- data/lib/2016-10-01/generated/azure_mgmt_key_vault/models/vault_access_policy_properties.rb +0 -0
- data/lib/2016-10-01/generated/azure_mgmt_key_vault/models/vault_check_name_availability_parameters.rb +0 -0
- data/lib/2016-10-01/generated/azure_mgmt_key_vault/models/vault_create_or_update_parameters.rb +0 -0
- data/lib/2016-10-01/generated/azure_mgmt_key_vault/models/vault_list_result.rb +0 -0
- data/lib/2016-10-01/generated/azure_mgmt_key_vault/models/vault_patch_parameters.rb +0 -0
- data/lib/2016-10-01/generated/azure_mgmt_key_vault/models/vault_patch_properties.rb +0 -0
- data/lib/2016-10-01/generated/azure_mgmt_key_vault/models/vault_properties.rb +0 -0
- data/lib/2016-10-01/generated/azure_mgmt_key_vault/module_definition.rb +0 -0
- data/lib/2016-10-01/generated/azure_mgmt_key_vault/operations.rb +4 -0
- data/lib/2016-10-01/generated/azure_mgmt_key_vault/vaults.rb +32 -0
- data/lib/2018-02-14-preview/generated/azure_mgmt_key_vault.rb +74 -0
- data/lib/2018-02-14-preview/generated/azure_mgmt_key_vault/key_vault_management_client.rb +141 -0
- data/lib/2018-02-14-preview/generated/azure_mgmt_key_vault/models/access_policy_entry.rb +86 -0
- data/lib/2018-02-14-preview/generated/azure_mgmt_key_vault/models/access_policy_update_kind.rb +17 -0
- data/lib/2018-02-14-preview/generated/azure_mgmt_key_vault/models/attributes.rb +92 -0
- data/lib/2018-02-14-preview/generated/azure_mgmt_key_vault/models/certificate_permissions.rb +30 -0
- data/lib/2018-02-14-preview/generated/azure_mgmt_key_vault/models/check_name_availability_result.rb +77 -0
- data/lib/2018-02-14-preview/generated/azure_mgmt_key_vault/models/create_mode.rb +16 -0
- data/lib/2018-02-14-preview/generated/azure_mgmt_key_vault/models/deleted_vault.rb +83 -0
- data/lib/2018-02-14-preview/generated/azure_mgmt_key_vault/models/deleted_vault_list_result.rb +98 -0
- data/lib/2018-02-14-preview/generated/azure_mgmt_key_vault/models/deleted_vault_properties.rb +103 -0
- data/lib/2018-02-14-preview/generated/azure_mgmt_key_vault/models/iprule.rb +49 -0
- data/lib/2018-02-14-preview/generated/azure_mgmt_key_vault/models/key_permissions.rb +30 -0
- data/lib/2018-02-14-preview/generated/azure_mgmt_key_vault/models/log_specification.rb +68 -0
- data/lib/2018-02-14-preview/generated/azure_mgmt_key_vault/models/network_rule_action.rb +16 -0
- data/lib/2018-02-14-preview/generated/azure_mgmt_key_vault/models/network_rule_bypass_options.rb +16 -0
- data/lib/2018-02-14-preview/generated/azure_mgmt_key_vault/models/network_rule_set.rb +103 -0
- data/lib/2018-02-14-preview/generated/azure_mgmt_key_vault/models/operation.rb +83 -0
- data/lib/2018-02-14-preview/generated/azure_mgmt_key_vault/models/operation_display.rb +79 -0
- data/lib/2018-02-14-preview/generated/azure_mgmt_key_vault/models/operation_list_result.rb +100 -0
- data/lib/2018-02-14-preview/generated/azure_mgmt_key_vault/models/permissions.rb +111 -0
- data/lib/2018-02-14-preview/generated/azure_mgmt_key_vault/models/reason.rb +16 -0
- data/lib/2018-02-14-preview/generated/azure_mgmt_key_vault/models/resource.rb +113 -0
- data/lib/2018-02-14-preview/generated/azure_mgmt_key_vault/models/resource_list_result.rb +98 -0
- data/lib/2018-02-14-preview/generated/azure_mgmt_key_vault/models/secret.rb +98 -0
- data/lib/2018-02-14-preview/generated/azure_mgmt_key_vault/models/secret_attributes.rb +77 -0
- data/lib/2018-02-14-preview/generated/azure_mgmt_key_vault/models/secret_create_or_update_parameters.rb +67 -0
- data/lib/2018-02-14-preview/generated/azure_mgmt_key_vault/models/secret_list_result.rb +98 -0
- data/lib/2018-02-14-preview/generated/azure_mgmt_key_vault/models/secret_patch_parameters.rb +67 -0
- data/lib/2018-02-14-preview/generated/azure_mgmt_key_vault/models/secret_patch_properties.rb +69 -0
- data/lib/2018-02-14-preview/generated/azure_mgmt_key_vault/models/secret_permissions.rb +22 -0
- data/lib/2018-02-14-preview/generated/azure_mgmt_key_vault/models/secret_properties.rb +97 -0
- data/lib/2018-02-14-preview/generated/azure_mgmt_key_vault/models/service_specification.rb +55 -0
- data/lib/2018-02-14-preview/generated/azure_mgmt_key_vault/models/sku.rb +62 -0
- data/lib/2018-02-14-preview/generated/azure_mgmt_key_vault/models/sku_name.rb +16 -0
- data/lib/2018-02-14-preview/generated/azure_mgmt_key_vault/models/storage_permissions.rb +28 -0
- data/lib/2018-02-14-preview/generated/azure_mgmt_key_vault/models/vault.rb +99 -0
- data/lib/2018-02-14-preview/generated/azure_mgmt_key_vault/models/vault_access_policy_parameters.rb +95 -0
- data/lib/2018-02-14-preview/generated/azure_mgmt_key_vault/models/vault_access_policy_properties.rb +57 -0
- data/lib/2018-02-14-preview/generated/azure_mgmt_key_vault/models/vault_check_name_availability_parameters.rb +60 -0
- data/lib/2018-02-14-preview/generated/azure_mgmt_key_vault/models/vault_create_or_update_parameters.rb +80 -0
- data/lib/2018-02-14-preview/generated/azure_mgmt_key_vault/models/vault_list_result.rb +98 -0
- data/lib/2018-02-14-preview/generated/azure_mgmt_key_vault/models/vault_patch_parameters.rb +67 -0
- data/lib/2018-02-14-preview/generated/azure_mgmt_key_vault/models/vault_patch_properties.rb +175 -0
- data/lib/2018-02-14-preview/generated/azure_mgmt_key_vault/models/vault_properties.rb +188 -0
- data/lib/2018-02-14-preview/generated/azure_mgmt_key_vault/models/virtual_network_rule.rb +48 -0
- data/lib/2018-02-14-preview/generated/azure_mgmt_key_vault/module_definition.rb +9 -0
- data/lib/2018-02-14-preview/generated/azure_mgmt_key_vault/operations.rb +220 -0
- data/lib/2018-02-14-preview/generated/azure_mgmt_key_vault/secrets.rb +624 -0
- data/lib/2018-02-14-preview/generated/azure_mgmt_key_vault/vaults.rb +1771 -0
- data/lib/2018-02-14/generated/azure_mgmt_key_vault.rb +0 -0
- data/lib/2018-02-14/generated/azure_mgmt_key_vault/key_vault_management_client.rb +1 -1
- data/lib/2018-02-14/generated/azure_mgmt_key_vault/models/access_policy_entry.rb +0 -0
- data/lib/2018-02-14/generated/azure_mgmt_key_vault/models/access_policy_update_kind.rb +0 -0
- data/lib/2018-02-14/generated/azure_mgmt_key_vault/models/certificate_permissions.rb +0 -0
- data/lib/2018-02-14/generated/azure_mgmt_key_vault/models/check_name_availability_result.rb +0 -0
- data/lib/2018-02-14/generated/azure_mgmt_key_vault/models/create_mode.rb +0 -0
- data/lib/2018-02-14/generated/azure_mgmt_key_vault/models/deleted_vault.rb +0 -0
- data/lib/2018-02-14/generated/azure_mgmt_key_vault/models/deleted_vault_list_result.rb +0 -0
- data/lib/2018-02-14/generated/azure_mgmt_key_vault/models/deleted_vault_properties.rb +0 -0
- data/lib/2018-02-14/generated/azure_mgmt_key_vault/models/iprule.rb +0 -0
- data/lib/2018-02-14/generated/azure_mgmt_key_vault/models/key_permissions.rb +0 -0
- data/lib/2018-02-14/generated/azure_mgmt_key_vault/models/log_specification.rb +0 -0
- data/lib/2018-02-14/generated/azure_mgmt_key_vault/models/network_rule_action.rb +0 -0
- data/lib/2018-02-14/generated/azure_mgmt_key_vault/models/network_rule_bypass_options.rb +0 -0
- data/lib/2018-02-14/generated/azure_mgmt_key_vault/models/network_rule_set.rb +0 -0
- data/lib/2018-02-14/generated/azure_mgmt_key_vault/models/operation.rb +0 -0
- data/lib/2018-02-14/generated/azure_mgmt_key_vault/models/operation_display.rb +0 -0
- data/lib/2018-02-14/generated/azure_mgmt_key_vault/models/operation_list_result.rb +0 -0
- data/lib/2018-02-14/generated/azure_mgmt_key_vault/models/permissions.rb +0 -0
- data/lib/2018-02-14/generated/azure_mgmt_key_vault/models/reason.rb +0 -0
- data/lib/2018-02-14/generated/azure_mgmt_key_vault/models/resource.rb +0 -0
- data/lib/2018-02-14/generated/azure_mgmt_key_vault/models/resource_list_result.rb +0 -0
- data/lib/2018-02-14/generated/azure_mgmt_key_vault/models/secret_permissions.rb +0 -0
- data/lib/2018-02-14/generated/azure_mgmt_key_vault/models/service_specification.rb +0 -0
- data/lib/2018-02-14/generated/azure_mgmt_key_vault/models/sku.rb +0 -0
- data/lib/2018-02-14/generated/azure_mgmt_key_vault/models/sku_name.rb +0 -0
- data/lib/2018-02-14/generated/azure_mgmt_key_vault/models/storage_permissions.rb +0 -0
- data/lib/2018-02-14/generated/azure_mgmt_key_vault/models/vault.rb +0 -0
- data/lib/2018-02-14/generated/azure_mgmt_key_vault/models/vault_access_policy_parameters.rb +0 -0
- data/lib/2018-02-14/generated/azure_mgmt_key_vault/models/vault_access_policy_properties.rb +0 -0
- data/lib/2018-02-14/generated/azure_mgmt_key_vault/models/vault_check_name_availability_parameters.rb +0 -0
- data/lib/2018-02-14/generated/azure_mgmt_key_vault/models/vault_create_or_update_parameters.rb +0 -0
- data/lib/2018-02-14/generated/azure_mgmt_key_vault/models/vault_list_result.rb +0 -0
- data/lib/2018-02-14/generated/azure_mgmt_key_vault/models/vault_patch_parameters.rb +0 -0
- data/lib/2018-02-14/generated/azure_mgmt_key_vault/models/vault_patch_properties.rb +0 -0
- data/lib/2018-02-14/generated/azure_mgmt_key_vault/models/vault_properties.rb +0 -0
- data/lib/2018-02-14/generated/azure_mgmt_key_vault/models/virtual_network_rule.rb +0 -0
- data/lib/2018-02-14/generated/azure_mgmt_key_vault/module_definition.rb +0 -0
- data/lib/2018-02-14/generated/azure_mgmt_key_vault/operations.rb +4 -0
- data/lib/2018-02-14/generated/azure_mgmt_key_vault/vaults.rb +32 -0
- data/lib/azure_mgmt_key_vault.rb +5 -4
- data/lib/module_definition.rb +9 -9
- data/lib/profiles/latest/keyvault_latest_profile_client.rb +40 -40
- data/lib/profiles/latest/keyvault_module_definition.rb +8 -8
- data/lib/profiles/latest/modules/keyvault_profile_module.rb +207 -207
- data/lib/profiles/v2017_03_09/keyvault_module_definition.rb +8 -8
- data/lib/profiles/v2017_03_09/keyvault_v2017_03_09_profile_client.rb +40 -40
- data/lib/profiles/v2017_03_09/modules/keyvault_profile_module.rb +187 -187
- data/lib/profiles/v2018_03_01/keyvault_module_definition.rb +8 -8
- data/lib/profiles/v2018_03_01/keyvault_v2018_03_01_profile_client.rb +40 -40
- data/lib/profiles/v2018_03_01/modules/keyvault_profile_module.rb +187 -187
- data/lib/profiles/v2019_03_01_hybrid/keyvault_module_definition.rb +8 -8
- data/lib/profiles/v2019_03_01_hybrid/keyvault_v2019_03_01_hybrid_profile_client.rb +40 -40
- data/lib/profiles/v2019_03_01_hybrid/modules/keyvault_profile_module.rb +187 -187
- data/lib/version.rb +1 -1
- metadata +55 -5
@@ -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::KeyVault end
|
8
|
+
module Azure::KeyVault::Mgmt end
|
9
|
+
module Azure::KeyVault::Mgmt::V2018_02_14_preview end
|
@@ -0,0 +1,220 @@
|
|
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::KeyVault::Mgmt::V2018_02_14_preview
|
7
|
+
#
|
8
|
+
# The Azure management API provides a RESTful set of web services that
|
9
|
+
# interact with Azure Key Vault.
|
10
|
+
#
|
11
|
+
class Operations
|
12
|
+
include MsRestAzure
|
13
|
+
|
14
|
+
#
|
15
|
+
# Creates and initializes a new instance of the Operations class.
|
16
|
+
# @param client service class for accessing basic functionality.
|
17
|
+
#
|
18
|
+
def initialize(client)
|
19
|
+
@client = client
|
20
|
+
end
|
21
|
+
|
22
|
+
# @return [KeyVaultManagementClient] reference to the KeyVaultManagementClient
|
23
|
+
attr_reader :client
|
24
|
+
|
25
|
+
#
|
26
|
+
# Lists all of the available Key Vault Rest API operations.
|
27
|
+
#
|
28
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
29
|
+
# will be added to the HTTP request.
|
30
|
+
#
|
31
|
+
# @return [Array<Operation>] operation results.
|
32
|
+
#
|
33
|
+
def list(custom_headers:nil)
|
34
|
+
first_page = list_as_lazy(custom_headers:custom_headers)
|
35
|
+
first_page.get_all_items
|
36
|
+
end
|
37
|
+
|
38
|
+
#
|
39
|
+
# Lists all of the available Key Vault Rest API operations.
|
40
|
+
#
|
41
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
42
|
+
# will be added to the HTTP request.
|
43
|
+
#
|
44
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
45
|
+
#
|
46
|
+
def list_with_http_info(custom_headers:nil)
|
47
|
+
list_async(custom_headers:custom_headers).value!
|
48
|
+
end
|
49
|
+
|
50
|
+
#
|
51
|
+
# Lists all of the available Key Vault Rest API operations.
|
52
|
+
#
|
53
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
54
|
+
# to the HTTP request.
|
55
|
+
#
|
56
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
57
|
+
#
|
58
|
+
def list_async(custom_headers:nil)
|
59
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
60
|
+
|
61
|
+
|
62
|
+
request_headers = {}
|
63
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
64
|
+
|
65
|
+
# Set Headers
|
66
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
67
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
68
|
+
path_template = 'providers/Microsoft.KeyVault/operations'
|
69
|
+
|
70
|
+
request_url = @base_url || @client.base_url
|
71
|
+
|
72
|
+
options = {
|
73
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
74
|
+
query_params: {'api-version' => @client.api_version},
|
75
|
+
headers: request_headers.merge(custom_headers || {}),
|
76
|
+
base_url: request_url
|
77
|
+
}
|
78
|
+
promise = @client.make_request_async(:get, path_template, options)
|
79
|
+
|
80
|
+
promise = promise.then do |result|
|
81
|
+
http_response = result.response
|
82
|
+
status_code = http_response.status
|
83
|
+
response_content = http_response.body
|
84
|
+
unless status_code == 200
|
85
|
+
error_model = JSON.load(response_content)
|
86
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
87
|
+
end
|
88
|
+
|
89
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
90
|
+
result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
|
91
|
+
result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
|
92
|
+
# Deserialize Response
|
93
|
+
if status_code == 200
|
94
|
+
begin
|
95
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
96
|
+
result_mapper = Azure::KeyVault::Mgmt::V2018_02_14_preview::Models::OperationListResult.mapper()
|
97
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
98
|
+
rescue Exception => e
|
99
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
100
|
+
end
|
101
|
+
end
|
102
|
+
|
103
|
+
result
|
104
|
+
end
|
105
|
+
|
106
|
+
promise.execute
|
107
|
+
end
|
108
|
+
|
109
|
+
#
|
110
|
+
# Lists all of the available Key Vault Rest API operations.
|
111
|
+
#
|
112
|
+
# @param next_page_link [String] The NextLink from the previous successful call
|
113
|
+
# to List operation.
|
114
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
115
|
+
# will be added to the HTTP request.
|
116
|
+
#
|
117
|
+
# @return [OperationListResult] operation results.
|
118
|
+
#
|
119
|
+
def list_next(next_page_link, custom_headers:nil)
|
120
|
+
response = list_next_async(next_page_link, custom_headers:custom_headers).value!
|
121
|
+
response.body unless response.nil?
|
122
|
+
end
|
123
|
+
|
124
|
+
#
|
125
|
+
# Lists all of the available Key Vault Rest API operations.
|
126
|
+
#
|
127
|
+
# @param next_page_link [String] The NextLink from the previous successful call
|
128
|
+
# to List operation.
|
129
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
130
|
+
# will be added to the HTTP request.
|
131
|
+
#
|
132
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
133
|
+
#
|
134
|
+
def list_next_with_http_info(next_page_link, custom_headers:nil)
|
135
|
+
list_next_async(next_page_link, custom_headers:custom_headers).value!
|
136
|
+
end
|
137
|
+
|
138
|
+
#
|
139
|
+
# Lists all of the available Key Vault Rest API operations.
|
140
|
+
#
|
141
|
+
# @param next_page_link [String] The NextLink from the previous successful call
|
142
|
+
# to List operation.
|
143
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
144
|
+
# to the HTTP request.
|
145
|
+
#
|
146
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
147
|
+
#
|
148
|
+
def list_next_async(next_page_link, custom_headers:nil)
|
149
|
+
fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
|
150
|
+
|
151
|
+
|
152
|
+
request_headers = {}
|
153
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
154
|
+
|
155
|
+
# Set Headers
|
156
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
157
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
158
|
+
path_template = '{nextLink}'
|
159
|
+
|
160
|
+
request_url = @base_url || @client.base_url
|
161
|
+
|
162
|
+
options = {
|
163
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
164
|
+
skip_encoding_path_params: {'nextLink' => next_page_link},
|
165
|
+
headers: request_headers.merge(custom_headers || {}),
|
166
|
+
base_url: request_url
|
167
|
+
}
|
168
|
+
promise = @client.make_request_async(:get, path_template, options)
|
169
|
+
|
170
|
+
promise = promise.then do |result|
|
171
|
+
http_response = result.response
|
172
|
+
status_code = http_response.status
|
173
|
+
response_content = http_response.body
|
174
|
+
unless status_code == 200
|
175
|
+
error_model = JSON.load(response_content)
|
176
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
177
|
+
end
|
178
|
+
|
179
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
180
|
+
result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
|
181
|
+
result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
|
182
|
+
# Deserialize Response
|
183
|
+
if status_code == 200
|
184
|
+
begin
|
185
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
186
|
+
result_mapper = Azure::KeyVault::Mgmt::V2018_02_14_preview::Models::OperationListResult.mapper()
|
187
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
188
|
+
rescue Exception => e
|
189
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
190
|
+
end
|
191
|
+
end
|
192
|
+
|
193
|
+
result
|
194
|
+
end
|
195
|
+
|
196
|
+
promise.execute
|
197
|
+
end
|
198
|
+
|
199
|
+
#
|
200
|
+
# Lists all of the available Key Vault Rest API operations.
|
201
|
+
#
|
202
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
203
|
+
# will be added to the HTTP request.
|
204
|
+
#
|
205
|
+
# @return [OperationListResult] which provide lazy access to pages of the
|
206
|
+
# response.
|
207
|
+
#
|
208
|
+
def list_as_lazy(custom_headers:nil)
|
209
|
+
response = list_async(custom_headers:custom_headers).value!
|
210
|
+
unless response.nil?
|
211
|
+
page = response.body
|
212
|
+
page.next_method = Proc.new do |next_page_link|
|
213
|
+
list_next_async(next_page_link, custom_headers:custom_headers)
|
214
|
+
end
|
215
|
+
page
|
216
|
+
end
|
217
|
+
end
|
218
|
+
|
219
|
+
end
|
220
|
+
end
|
@@ -0,0 +1,624 @@
|
|
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::KeyVault::Mgmt::V2018_02_14_preview
|
7
|
+
#
|
8
|
+
# The Azure management API provides a RESTful set of web services that
|
9
|
+
# interact with Azure Key Vault.
|
10
|
+
#
|
11
|
+
class Secrets
|
12
|
+
include MsRestAzure
|
13
|
+
|
14
|
+
#
|
15
|
+
# Creates and initializes a new instance of the Secrets class.
|
16
|
+
# @param client service class for accessing basic functionality.
|
17
|
+
#
|
18
|
+
def initialize(client)
|
19
|
+
@client = client
|
20
|
+
end
|
21
|
+
|
22
|
+
# @return [KeyVaultManagementClient] reference to the KeyVaultManagementClient
|
23
|
+
attr_reader :client
|
24
|
+
|
25
|
+
#
|
26
|
+
# Create or update a secret in a key vault in the specified subscription.
|
27
|
+
# NOTE: This API is intended for internal use in ARM deployments. Users should
|
28
|
+
# use the data-plane REST service for interaction with vault secrets.
|
29
|
+
#
|
30
|
+
# @param resource_group_name [String] The name of the Resource Group to which
|
31
|
+
# the vault belongs.
|
32
|
+
# @param vault_name [String] Name of the vault
|
33
|
+
# @param secret_name [String] Name of the secret
|
34
|
+
# @param parameters [SecretCreateOrUpdateParameters] Parameters to create or
|
35
|
+
# update the secret
|
36
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
37
|
+
# will be added to the HTTP request.
|
38
|
+
#
|
39
|
+
# @return [Secret] operation results.
|
40
|
+
#
|
41
|
+
def create_or_update(resource_group_name, vault_name, secret_name, parameters, custom_headers:nil)
|
42
|
+
response = create_or_update_async(resource_group_name, vault_name, secret_name, parameters, custom_headers:custom_headers).value!
|
43
|
+
response.body unless response.nil?
|
44
|
+
end
|
45
|
+
|
46
|
+
#
|
47
|
+
# Create or update a secret in a key vault in the specified subscription.
|
48
|
+
# NOTE: This API is intended for internal use in ARM deployments. Users should
|
49
|
+
# use the data-plane REST service for interaction with vault secrets.
|
50
|
+
#
|
51
|
+
# @param resource_group_name [String] The name of the Resource Group to which
|
52
|
+
# the vault belongs.
|
53
|
+
# @param vault_name [String] Name of the vault
|
54
|
+
# @param secret_name [String] Name of the secret
|
55
|
+
# @param parameters [SecretCreateOrUpdateParameters] Parameters to create or
|
56
|
+
# update the secret
|
57
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
58
|
+
# will be added to the HTTP request.
|
59
|
+
#
|
60
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
61
|
+
#
|
62
|
+
def create_or_update_with_http_info(resource_group_name, vault_name, secret_name, parameters, custom_headers:nil)
|
63
|
+
create_or_update_async(resource_group_name, vault_name, secret_name, parameters, custom_headers:custom_headers).value!
|
64
|
+
end
|
65
|
+
|
66
|
+
#
|
67
|
+
# Create or update a secret in a key vault in the specified subscription.
|
68
|
+
# NOTE: This API is intended for internal use in ARM deployments. Users should
|
69
|
+
# use the data-plane REST service for interaction with vault secrets.
|
70
|
+
#
|
71
|
+
# @param resource_group_name [String] The name of the Resource Group to which
|
72
|
+
# the vault belongs.
|
73
|
+
# @param vault_name [String] Name of the vault
|
74
|
+
# @param secret_name [String] Name of the secret
|
75
|
+
# @param parameters [SecretCreateOrUpdateParameters] Parameters to create or
|
76
|
+
# update the secret
|
77
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
78
|
+
# to the HTTP request.
|
79
|
+
#
|
80
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
81
|
+
#
|
82
|
+
def create_or_update_async(resource_group_name, vault_name, secret_name, parameters, custom_headers:nil)
|
83
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
84
|
+
fail ArgumentError, 'vault_name is nil' if vault_name.nil?
|
85
|
+
fail ArgumentError, "'vault_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z0-9-]{3,24}$'" if !vault_name.nil? && vault_name.match(Regexp.new('^^[a-zA-Z0-9-]{3,24}$$')).nil?
|
86
|
+
fail ArgumentError, 'secret_name is nil' if secret_name.nil?
|
87
|
+
fail ArgumentError, "'secret_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z0-9-]{1,127}$'" if !secret_name.nil? && secret_name.match(Regexp.new('^^[a-zA-Z0-9-]{1,127}$$')).nil?
|
88
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
89
|
+
fail ArgumentError, 'parameters is nil' if parameters.nil?
|
90
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
91
|
+
|
92
|
+
|
93
|
+
request_headers = {}
|
94
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
95
|
+
|
96
|
+
# Set Headers
|
97
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
98
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
99
|
+
|
100
|
+
# Serialize Request
|
101
|
+
request_mapper = Azure::KeyVault::Mgmt::V2018_02_14_preview::Models::SecretCreateOrUpdateParameters.mapper()
|
102
|
+
request_content = @client.serialize(request_mapper, parameters)
|
103
|
+
request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
|
104
|
+
|
105
|
+
path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName}/secrets/{secretName}'
|
106
|
+
|
107
|
+
request_url = @base_url || @client.base_url
|
108
|
+
|
109
|
+
options = {
|
110
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
111
|
+
path_params: {'resourceGroupName' => resource_group_name,'vaultName' => vault_name,'secretName' => secret_name,'subscriptionId' => @client.subscription_id},
|
112
|
+
query_params: {'api-version' => @client.api_version},
|
113
|
+
body: request_content,
|
114
|
+
headers: request_headers.merge(custom_headers || {}),
|
115
|
+
base_url: request_url
|
116
|
+
}
|
117
|
+
promise = @client.make_request_async(:put, path_template, options)
|
118
|
+
|
119
|
+
promise = promise.then do |result|
|
120
|
+
http_response = result.response
|
121
|
+
status_code = http_response.status
|
122
|
+
response_content = http_response.body
|
123
|
+
unless status_code == 201 || status_code == 200
|
124
|
+
error_model = JSON.load(response_content)
|
125
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
126
|
+
end
|
127
|
+
|
128
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
129
|
+
result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
|
130
|
+
result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
|
131
|
+
# Deserialize Response
|
132
|
+
if status_code == 201
|
133
|
+
begin
|
134
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
135
|
+
result_mapper = Azure::KeyVault::Mgmt::V2018_02_14_preview::Models::Secret.mapper()
|
136
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
137
|
+
rescue Exception => e
|
138
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
139
|
+
end
|
140
|
+
end
|
141
|
+
# Deserialize Response
|
142
|
+
if status_code == 200
|
143
|
+
begin
|
144
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
145
|
+
result_mapper = Azure::KeyVault::Mgmt::V2018_02_14_preview::Models::Secret.mapper()
|
146
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
147
|
+
rescue Exception => e
|
148
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
149
|
+
end
|
150
|
+
end
|
151
|
+
|
152
|
+
result
|
153
|
+
end
|
154
|
+
|
155
|
+
promise.execute
|
156
|
+
end
|
157
|
+
|
158
|
+
#
|
159
|
+
# Update a secret in the specified subscription. NOTE: This API is intended
|
160
|
+
# for internal use in ARM deployments. Users should use the data-plane REST
|
161
|
+
# service for interaction with vault secrets.
|
162
|
+
#
|
163
|
+
# @param resource_group_name [String] The name of the Resource Group to which
|
164
|
+
# the vault belongs.
|
165
|
+
# @param vault_name [String] Name of the vault
|
166
|
+
# @param secret_name [String] Name of the secret
|
167
|
+
# @param parameters [SecretPatchParameters] Parameters to patch the secret
|
168
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
169
|
+
# will be added to the HTTP request.
|
170
|
+
#
|
171
|
+
# @return [Secret] operation results.
|
172
|
+
#
|
173
|
+
def update(resource_group_name, vault_name, secret_name, parameters, custom_headers:nil)
|
174
|
+
response = update_async(resource_group_name, vault_name, secret_name, parameters, custom_headers:custom_headers).value!
|
175
|
+
response.body unless response.nil?
|
176
|
+
end
|
177
|
+
|
178
|
+
#
|
179
|
+
# Update a secret in the specified subscription. NOTE: This API is intended
|
180
|
+
# for internal use in ARM deployments. Users should use the data-plane REST
|
181
|
+
# service for interaction with vault secrets.
|
182
|
+
#
|
183
|
+
# @param resource_group_name [String] The name of the Resource Group to which
|
184
|
+
# the vault belongs.
|
185
|
+
# @param vault_name [String] Name of the vault
|
186
|
+
# @param secret_name [String] Name of the secret
|
187
|
+
# @param parameters [SecretPatchParameters] Parameters to patch the secret
|
188
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
189
|
+
# will be added to the HTTP request.
|
190
|
+
#
|
191
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
192
|
+
#
|
193
|
+
def update_with_http_info(resource_group_name, vault_name, secret_name, parameters, custom_headers:nil)
|
194
|
+
update_async(resource_group_name, vault_name, secret_name, parameters, custom_headers:custom_headers).value!
|
195
|
+
end
|
196
|
+
|
197
|
+
#
|
198
|
+
# Update a secret in the specified subscription. NOTE: This API is intended
|
199
|
+
# for internal use in ARM deployments. Users should use the data-plane REST
|
200
|
+
# service for interaction with vault secrets.
|
201
|
+
#
|
202
|
+
# @param resource_group_name [String] The name of the Resource Group to which
|
203
|
+
# the vault belongs.
|
204
|
+
# @param vault_name [String] Name of the vault
|
205
|
+
# @param secret_name [String] Name of the secret
|
206
|
+
# @param parameters [SecretPatchParameters] Parameters to patch the secret
|
207
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
208
|
+
# to the HTTP request.
|
209
|
+
#
|
210
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
211
|
+
#
|
212
|
+
def update_async(resource_group_name, vault_name, secret_name, parameters, custom_headers:nil)
|
213
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
214
|
+
fail ArgumentError, 'vault_name is nil' if vault_name.nil?
|
215
|
+
fail ArgumentError, "'vault_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z0-9-]{3,24}$'" if !vault_name.nil? && vault_name.match(Regexp.new('^^[a-zA-Z0-9-]{3,24}$$')).nil?
|
216
|
+
fail ArgumentError, 'secret_name is nil' if secret_name.nil?
|
217
|
+
fail ArgumentError, "'secret_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z0-9-]{1,127}$'" if !secret_name.nil? && secret_name.match(Regexp.new('^^[a-zA-Z0-9-]{1,127}$$')).nil?
|
218
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
219
|
+
fail ArgumentError, 'parameters is nil' if parameters.nil?
|
220
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
221
|
+
|
222
|
+
|
223
|
+
request_headers = {}
|
224
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
225
|
+
|
226
|
+
# Set Headers
|
227
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
228
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
229
|
+
|
230
|
+
# Serialize Request
|
231
|
+
request_mapper = Azure::KeyVault::Mgmt::V2018_02_14_preview::Models::SecretPatchParameters.mapper()
|
232
|
+
request_content = @client.serialize(request_mapper, parameters)
|
233
|
+
request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
|
234
|
+
|
235
|
+
path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName}/secrets/{secretName}'
|
236
|
+
|
237
|
+
request_url = @base_url || @client.base_url
|
238
|
+
|
239
|
+
options = {
|
240
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
241
|
+
path_params: {'resourceGroupName' => resource_group_name,'vaultName' => vault_name,'secretName' => secret_name,'subscriptionId' => @client.subscription_id},
|
242
|
+
query_params: {'api-version' => @client.api_version},
|
243
|
+
body: request_content,
|
244
|
+
headers: request_headers.merge(custom_headers || {}),
|
245
|
+
base_url: request_url
|
246
|
+
}
|
247
|
+
promise = @client.make_request_async(:patch, path_template, options)
|
248
|
+
|
249
|
+
promise = promise.then do |result|
|
250
|
+
http_response = result.response
|
251
|
+
status_code = http_response.status
|
252
|
+
response_content = http_response.body
|
253
|
+
unless status_code == 201 || status_code == 200
|
254
|
+
error_model = JSON.load(response_content)
|
255
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
256
|
+
end
|
257
|
+
|
258
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
259
|
+
result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
|
260
|
+
result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
|
261
|
+
# Deserialize Response
|
262
|
+
if status_code == 201
|
263
|
+
begin
|
264
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
265
|
+
result_mapper = Azure::KeyVault::Mgmt::V2018_02_14_preview::Models::Secret.mapper()
|
266
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
267
|
+
rescue Exception => e
|
268
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
269
|
+
end
|
270
|
+
end
|
271
|
+
# Deserialize Response
|
272
|
+
if status_code == 200
|
273
|
+
begin
|
274
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
275
|
+
result_mapper = Azure::KeyVault::Mgmt::V2018_02_14_preview::Models::Secret.mapper()
|
276
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
277
|
+
rescue Exception => e
|
278
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
279
|
+
end
|
280
|
+
end
|
281
|
+
|
282
|
+
result
|
283
|
+
end
|
284
|
+
|
285
|
+
promise.execute
|
286
|
+
end
|
287
|
+
|
288
|
+
#
|
289
|
+
# Gets the specified secret. NOTE: This API is intended for internal use in
|
290
|
+
# ARM deployments. Users should use the data-plane REST service for interaction
|
291
|
+
# with vault secrets.
|
292
|
+
#
|
293
|
+
# @param resource_group_name [String] The name of the Resource Group to which
|
294
|
+
# the vault belongs.
|
295
|
+
# @param vault_name [String] The name of the vault.
|
296
|
+
# @param secret_name [String] The name of the secret.
|
297
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
298
|
+
# will be added to the HTTP request.
|
299
|
+
#
|
300
|
+
# @return [Secret] operation results.
|
301
|
+
#
|
302
|
+
def get(resource_group_name, vault_name, secret_name, custom_headers:nil)
|
303
|
+
response = get_async(resource_group_name, vault_name, secret_name, custom_headers:custom_headers).value!
|
304
|
+
response.body unless response.nil?
|
305
|
+
end
|
306
|
+
|
307
|
+
#
|
308
|
+
# Gets the specified secret. NOTE: This API is intended for internal use in
|
309
|
+
# ARM deployments. Users should use the data-plane REST service for interaction
|
310
|
+
# with vault secrets.
|
311
|
+
#
|
312
|
+
# @param resource_group_name [String] The name of the Resource Group to which
|
313
|
+
# the vault belongs.
|
314
|
+
# @param vault_name [String] The name of the vault.
|
315
|
+
# @param secret_name [String] The name of the secret.
|
316
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
317
|
+
# will be added to the HTTP request.
|
318
|
+
#
|
319
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
320
|
+
#
|
321
|
+
def get_with_http_info(resource_group_name, vault_name, secret_name, custom_headers:nil)
|
322
|
+
get_async(resource_group_name, vault_name, secret_name, custom_headers:custom_headers).value!
|
323
|
+
end
|
324
|
+
|
325
|
+
#
|
326
|
+
# Gets the specified secret. NOTE: This API is intended for internal use in
|
327
|
+
# ARM deployments. Users should use the data-plane REST service for interaction
|
328
|
+
# with vault secrets.
|
329
|
+
#
|
330
|
+
# @param resource_group_name [String] The name of the Resource Group to which
|
331
|
+
# the vault belongs.
|
332
|
+
# @param vault_name [String] The name of the vault.
|
333
|
+
# @param secret_name [String] The name of the secret.
|
334
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
335
|
+
# to the HTTP request.
|
336
|
+
#
|
337
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
338
|
+
#
|
339
|
+
def get_async(resource_group_name, vault_name, secret_name, custom_headers:nil)
|
340
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
341
|
+
fail ArgumentError, 'vault_name is nil' if vault_name.nil?
|
342
|
+
fail ArgumentError, 'secret_name is nil' if secret_name.nil?
|
343
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
344
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
345
|
+
|
346
|
+
|
347
|
+
request_headers = {}
|
348
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
349
|
+
|
350
|
+
# Set Headers
|
351
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
352
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
353
|
+
path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName}/secrets/{secretName}'
|
354
|
+
|
355
|
+
request_url = @base_url || @client.base_url
|
356
|
+
|
357
|
+
options = {
|
358
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
359
|
+
path_params: {'resourceGroupName' => resource_group_name,'vaultName' => vault_name,'secretName' => secret_name,'subscriptionId' => @client.subscription_id},
|
360
|
+
query_params: {'api-version' => @client.api_version},
|
361
|
+
headers: request_headers.merge(custom_headers || {}),
|
362
|
+
base_url: request_url
|
363
|
+
}
|
364
|
+
promise = @client.make_request_async(:get, path_template, options)
|
365
|
+
|
366
|
+
promise = promise.then do |result|
|
367
|
+
http_response = result.response
|
368
|
+
status_code = http_response.status
|
369
|
+
response_content = http_response.body
|
370
|
+
unless status_code == 200
|
371
|
+
error_model = JSON.load(response_content)
|
372
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
373
|
+
end
|
374
|
+
|
375
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
376
|
+
result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
|
377
|
+
result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
|
378
|
+
# Deserialize Response
|
379
|
+
if status_code == 200
|
380
|
+
begin
|
381
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
382
|
+
result_mapper = Azure::KeyVault::Mgmt::V2018_02_14_preview::Models::Secret.mapper()
|
383
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
384
|
+
rescue Exception => e
|
385
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
386
|
+
end
|
387
|
+
end
|
388
|
+
|
389
|
+
result
|
390
|
+
end
|
391
|
+
|
392
|
+
promise.execute
|
393
|
+
end
|
394
|
+
|
395
|
+
#
|
396
|
+
# The List operation gets information about the secrets in a vault. NOTE: This
|
397
|
+
# API is intended for internal use in ARM deployments. Users should use the
|
398
|
+
# data-plane REST service for interaction with vault secrets.
|
399
|
+
#
|
400
|
+
# @param resource_group_name [String] The name of the Resource Group to which
|
401
|
+
# the vault belongs.
|
402
|
+
# @param vault_name [String] The name of the vault.
|
403
|
+
# @param top [Integer] Maximum number of results to return.
|
404
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
405
|
+
# will be added to the HTTP request.
|
406
|
+
#
|
407
|
+
# @return [Array<Secret>] operation results.
|
408
|
+
#
|
409
|
+
def list(resource_group_name, vault_name, top:nil, custom_headers:nil)
|
410
|
+
first_page = list_as_lazy(resource_group_name, vault_name, top:top, custom_headers:custom_headers)
|
411
|
+
first_page.get_all_items
|
412
|
+
end
|
413
|
+
|
414
|
+
#
|
415
|
+
# The List operation gets information about the secrets in a vault. NOTE: This
|
416
|
+
# API is intended for internal use in ARM deployments. Users should use the
|
417
|
+
# data-plane REST service for interaction with vault secrets.
|
418
|
+
#
|
419
|
+
# @param resource_group_name [String] The name of the Resource Group to which
|
420
|
+
# the vault belongs.
|
421
|
+
# @param vault_name [String] The name of the vault.
|
422
|
+
# @param top [Integer] Maximum number of results to return.
|
423
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
424
|
+
# will be added to the HTTP request.
|
425
|
+
#
|
426
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
427
|
+
#
|
428
|
+
def list_with_http_info(resource_group_name, vault_name, top:nil, custom_headers:nil)
|
429
|
+
list_async(resource_group_name, vault_name, top:top, custom_headers:custom_headers).value!
|
430
|
+
end
|
431
|
+
|
432
|
+
#
|
433
|
+
# The List operation gets information about the secrets in a vault. NOTE: This
|
434
|
+
# API is intended for internal use in ARM deployments. Users should use the
|
435
|
+
# data-plane REST service for interaction with vault secrets.
|
436
|
+
#
|
437
|
+
# @param resource_group_name [String] The name of the Resource Group to which
|
438
|
+
# the vault belongs.
|
439
|
+
# @param vault_name [String] The name of the vault.
|
440
|
+
# @param top [Integer] Maximum number of results to return.
|
441
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
442
|
+
# to the HTTP request.
|
443
|
+
#
|
444
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
445
|
+
#
|
446
|
+
def list_async(resource_group_name, vault_name, top:nil, custom_headers:nil)
|
447
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
448
|
+
fail ArgumentError, 'vault_name is nil' if vault_name.nil?
|
449
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
450
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
451
|
+
|
452
|
+
|
453
|
+
request_headers = {}
|
454
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
455
|
+
|
456
|
+
# Set Headers
|
457
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
458
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
459
|
+
path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName}/secrets'
|
460
|
+
|
461
|
+
request_url = @base_url || @client.base_url
|
462
|
+
|
463
|
+
options = {
|
464
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
465
|
+
path_params: {'resourceGroupName' => resource_group_name,'vaultName' => vault_name,'subscriptionId' => @client.subscription_id},
|
466
|
+
query_params: {'$top' => top,'api-version' => @client.api_version},
|
467
|
+
headers: request_headers.merge(custom_headers || {}),
|
468
|
+
base_url: request_url
|
469
|
+
}
|
470
|
+
promise = @client.make_request_async(:get, path_template, options)
|
471
|
+
|
472
|
+
promise = promise.then do |result|
|
473
|
+
http_response = result.response
|
474
|
+
status_code = http_response.status
|
475
|
+
response_content = http_response.body
|
476
|
+
unless status_code == 200
|
477
|
+
error_model = JSON.load(response_content)
|
478
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
479
|
+
end
|
480
|
+
|
481
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
482
|
+
result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
|
483
|
+
result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
|
484
|
+
# Deserialize Response
|
485
|
+
if status_code == 200
|
486
|
+
begin
|
487
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
488
|
+
result_mapper = Azure::KeyVault::Mgmt::V2018_02_14_preview::Models::SecretListResult.mapper()
|
489
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
490
|
+
rescue Exception => e
|
491
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
492
|
+
end
|
493
|
+
end
|
494
|
+
|
495
|
+
result
|
496
|
+
end
|
497
|
+
|
498
|
+
promise.execute
|
499
|
+
end
|
500
|
+
|
501
|
+
#
|
502
|
+
# The List operation gets information about the secrets in a vault. NOTE: This
|
503
|
+
# API is intended for internal use in ARM deployments. Users should use the
|
504
|
+
# data-plane REST service for interaction with vault secrets.
|
505
|
+
#
|
506
|
+
# @param next_page_link [String] The NextLink from the previous successful call
|
507
|
+
# to List operation.
|
508
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
509
|
+
# will be added to the HTTP request.
|
510
|
+
#
|
511
|
+
# @return [SecretListResult] operation results.
|
512
|
+
#
|
513
|
+
def list_next(next_page_link, custom_headers:nil)
|
514
|
+
response = list_next_async(next_page_link, custom_headers:custom_headers).value!
|
515
|
+
response.body unless response.nil?
|
516
|
+
end
|
517
|
+
|
518
|
+
#
|
519
|
+
# The List operation gets information about the secrets in a vault. NOTE: This
|
520
|
+
# API is intended for internal use in ARM deployments. Users should use the
|
521
|
+
# data-plane REST service for interaction with vault secrets.
|
522
|
+
#
|
523
|
+
# @param next_page_link [String] The NextLink from the previous successful call
|
524
|
+
# to List operation.
|
525
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
526
|
+
# will be added to the HTTP request.
|
527
|
+
#
|
528
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
529
|
+
#
|
530
|
+
def list_next_with_http_info(next_page_link, custom_headers:nil)
|
531
|
+
list_next_async(next_page_link, custom_headers:custom_headers).value!
|
532
|
+
end
|
533
|
+
|
534
|
+
#
|
535
|
+
# The List operation gets information about the secrets in a vault. NOTE: This
|
536
|
+
# API is intended for internal use in ARM deployments. Users should use the
|
537
|
+
# data-plane REST service for interaction with vault secrets.
|
538
|
+
#
|
539
|
+
# @param next_page_link [String] The NextLink from the previous successful call
|
540
|
+
# to List operation.
|
541
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
542
|
+
# to the HTTP request.
|
543
|
+
#
|
544
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
545
|
+
#
|
546
|
+
def list_next_async(next_page_link, custom_headers:nil)
|
547
|
+
fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
|
548
|
+
|
549
|
+
|
550
|
+
request_headers = {}
|
551
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
552
|
+
|
553
|
+
# Set Headers
|
554
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
555
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
556
|
+
path_template = '{nextLink}'
|
557
|
+
|
558
|
+
request_url = @base_url || @client.base_url
|
559
|
+
|
560
|
+
options = {
|
561
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
562
|
+
skip_encoding_path_params: {'nextLink' => next_page_link},
|
563
|
+
headers: request_headers.merge(custom_headers || {}),
|
564
|
+
base_url: request_url
|
565
|
+
}
|
566
|
+
promise = @client.make_request_async(:get, path_template, options)
|
567
|
+
|
568
|
+
promise = promise.then do |result|
|
569
|
+
http_response = result.response
|
570
|
+
status_code = http_response.status
|
571
|
+
response_content = http_response.body
|
572
|
+
unless status_code == 200
|
573
|
+
error_model = JSON.load(response_content)
|
574
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
575
|
+
end
|
576
|
+
|
577
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
578
|
+
result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
|
579
|
+
result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
|
580
|
+
# Deserialize Response
|
581
|
+
if status_code == 200
|
582
|
+
begin
|
583
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
584
|
+
result_mapper = Azure::KeyVault::Mgmt::V2018_02_14_preview::Models::SecretListResult.mapper()
|
585
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
586
|
+
rescue Exception => e
|
587
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
588
|
+
end
|
589
|
+
end
|
590
|
+
|
591
|
+
result
|
592
|
+
end
|
593
|
+
|
594
|
+
promise.execute
|
595
|
+
end
|
596
|
+
|
597
|
+
#
|
598
|
+
# The List operation gets information about the secrets in a vault. NOTE: This
|
599
|
+
# API is intended for internal use in ARM deployments. Users should use the
|
600
|
+
# data-plane REST service for interaction with vault secrets.
|
601
|
+
#
|
602
|
+
# @param resource_group_name [String] The name of the Resource Group to which
|
603
|
+
# the vault belongs.
|
604
|
+
# @param vault_name [String] The name of the vault.
|
605
|
+
# @param top [Integer] Maximum number of results to return.
|
606
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
607
|
+
# will be added to the HTTP request.
|
608
|
+
#
|
609
|
+
# @return [SecretListResult] which provide lazy access to pages of the
|
610
|
+
# response.
|
611
|
+
#
|
612
|
+
def list_as_lazy(resource_group_name, vault_name, top:nil, custom_headers:nil)
|
613
|
+
response = list_async(resource_group_name, vault_name, top:top, custom_headers:custom_headers).value!
|
614
|
+
unless response.nil?
|
615
|
+
page = response.body
|
616
|
+
page.next_method = Proc.new do |next_page_link|
|
617
|
+
list_next_async(next_page_link, custom_headers:custom_headers)
|
618
|
+
end
|
619
|
+
page
|
620
|
+
end
|
621
|
+
end
|
622
|
+
|
623
|
+
end
|
624
|
+
end
|