azure_mgmt_key_vault 0.15.2 → 0.16.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (30) hide show
  1. checksums.yaml +4 -4
  2. data/lib/2015-06-01/generated/azure_mgmt_key_vault/key_vault_management_client.rb +4 -1
  3. data/lib/2015-06-01/generated/azure_mgmt_key_vault/vaults.rb +48 -43
  4. data/lib/2016-10-01/generated/azure_mgmt_key_vault.rb +20 -6
  5. data/lib/2016-10-01/generated/azure_mgmt_key_vault/key_vault_management_client.rb +9 -2
  6. data/lib/2016-10-01/generated/azure_mgmt_key_vault/models/access_policy_update_kind.rb +17 -0
  7. data/lib/2016-10-01/generated/azure_mgmt_key_vault/models/check_name_availability_result.rb +77 -0
  8. data/lib/2016-10-01/generated/azure_mgmt_key_vault/models/log_specification.rb +68 -0
  9. data/lib/2016-10-01/generated/azure_mgmt_key_vault/models/operation.rb +83 -0
  10. data/lib/2016-10-01/generated/azure_mgmt_key_vault/models/operation_display.rb +79 -0
  11. data/lib/2016-10-01/generated/azure_mgmt_key_vault/models/operation_list_result.rb +100 -0
  12. data/lib/2016-10-01/generated/azure_mgmt_key_vault/models/reason.rb +16 -0
  13. data/lib/2016-10-01/generated/azure_mgmt_key_vault/models/resource.rb +2 -1
  14. data/lib/2016-10-01/generated/azure_mgmt_key_vault/models/resource_list_result.rb +2 -2
  15. data/lib/2016-10-01/generated/azure_mgmt_key_vault/models/service_specification.rb +55 -0
  16. data/lib/2016-10-01/generated/azure_mgmt_key_vault/models/vault.rb +2 -1
  17. data/lib/2016-10-01/generated/azure_mgmt_key_vault/models/vault_access_policy_parameters.rb +95 -0
  18. data/lib/2016-10-01/generated/azure_mgmt_key_vault/models/vault_access_policy_properties.rb +57 -0
  19. data/lib/2016-10-01/generated/azure_mgmt_key_vault/models/vault_check_name_availability_parameters.rb +60 -0
  20. data/lib/2016-10-01/generated/azure_mgmt_key_vault/models/vault_list_result.rb +2 -2
  21. data/lib/2016-10-01/generated/azure_mgmt_key_vault/models/vault_patch_parameters.rb +67 -0
  22. data/lib/2016-10-01/generated/azure_mgmt_key_vault/models/vault_patch_properties.rb +145 -0
  23. data/lib/2016-10-01/generated/azure_mgmt_key_vault/models/vault_properties.rb +1 -3
  24. data/lib/2016-10-01/generated/azure_mgmt_key_vault/operations.rb +216 -0
  25. data/lib/2016-10-01/generated/azure_mgmt_key_vault/vaults.rb +692 -91
  26. data/lib/profiles/latest/keyvault_latest_profile_client.rb +28 -9
  27. data/lib/profiles/latest/keyvault_module_definition.rb +0 -1
  28. data/lib/profiles/latest/modules/keyvault_profile_module.rb +142 -69
  29. data/lib/version.rb +1 -1
  30. metadata +17 -3
@@ -0,0 +1,57 @@
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::V2016_10_01
7
+ module Models
8
+ #
9
+ # Properties of the vault access policy
10
+ #
11
+ class VaultAccessPolicyProperties
12
+
13
+ include MsRestAzure
14
+
15
+ # @return [Array<AccessPolicyEntry>] An array of 0 to 16 identities that
16
+ # have access to the key vault. All identities in the array must use the
17
+ # same tenant ID as the key vault's tenant ID.
18
+ attr_accessor :access_policies
19
+
20
+
21
+ #
22
+ # Mapper for VaultAccessPolicyProperties class as Ruby Hash.
23
+ # This will be used for serialization/deserialization.
24
+ #
25
+ def self.mapper()
26
+ {
27
+ client_side_validation: true,
28
+ required: false,
29
+ serialized_name: 'VaultAccessPolicyProperties',
30
+ type: {
31
+ name: 'Composite',
32
+ class_name: 'VaultAccessPolicyProperties',
33
+ model_properties: {
34
+ access_policies: {
35
+ client_side_validation: true,
36
+ required: true,
37
+ serialized_name: 'accessPolicies',
38
+ type: {
39
+ name: 'Sequence',
40
+ element: {
41
+ client_side_validation: true,
42
+ required: false,
43
+ serialized_name: 'AccessPolicyEntryElementType',
44
+ type: {
45
+ name: 'Composite',
46
+ class_name: 'AccessPolicyEntry'
47
+ }
48
+ }
49
+ }
50
+ }
51
+ }
52
+ }
53
+ }
54
+ end
55
+ end
56
+ end
57
+ end
@@ -0,0 +1,60 @@
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::V2016_10_01
7
+ module Models
8
+ #
9
+ # The parameters used to check the availabity of the vault name.
10
+ #
11
+ class VaultCheckNameAvailabilityParameters
12
+
13
+ include MsRestAzure
14
+
15
+ # @return [String] The vault name.
16
+ attr_accessor :name
17
+
18
+ # @return [String] The type of resource, Microsoft.KeyVault/vaults.
19
+ # Default value: 'Microsoft.KeyVault/vaults' .
20
+ attr_accessor :type
21
+
22
+
23
+ #
24
+ # Mapper for VaultCheckNameAvailabilityParameters class as Ruby Hash.
25
+ # This will be used for serialization/deserialization.
26
+ #
27
+ def self.mapper()
28
+ {
29
+ client_side_validation: true,
30
+ required: false,
31
+ serialized_name: 'VaultCheckNameAvailabilityParameters',
32
+ type: {
33
+ name: 'Composite',
34
+ class_name: 'VaultCheckNameAvailabilityParameters',
35
+ model_properties: {
36
+ name: {
37
+ client_side_validation: true,
38
+ required: true,
39
+ serialized_name: 'name',
40
+ type: {
41
+ name: 'String'
42
+ }
43
+ },
44
+ type: {
45
+ client_side_validation: true,
46
+ required: true,
47
+ is_constant: true,
48
+ serialized_name: 'type',
49
+ default_value: 'Microsoft.KeyVault/vaults',
50
+ type: {
51
+ name: 'String'
52
+ }
53
+ }
54
+ }
55
+ }
56
+ }
57
+ end
58
+ end
59
+ end
60
+ end
@@ -13,10 +13,10 @@ module Azure::KeyVault::Mgmt::V2016_10_01
13
13
  include MsRestAzure
14
14
 
15
15
  include MsRest::JSONable
16
- # @return [Array<Vault>] Gets or sets the list of vaults.
16
+ # @return [Array<Vault>] The list of vaults.
17
17
  attr_accessor :value
18
18
 
19
- # @return [String] Gets or sets the URL to get the next set of vaults.
19
+ # @return [String] The URL to get the next set of vaults.
20
20
  attr_accessor :next_link
21
21
 
22
22
  # return [Proc] with next page method call.
@@ -0,0 +1,67 @@
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::V2016_10_01
7
+ module Models
8
+ #
9
+ # Parameters for creating or updating a vault
10
+ #
11
+ class VaultPatchParameters
12
+
13
+ include MsRestAzure
14
+
15
+ # @return [Hash{String => String}] The tags that will be assigned to the
16
+ # key vault.
17
+ attr_accessor :tags
18
+
19
+ # @return [VaultPatchProperties] Properties of the vault
20
+ attr_accessor :properties
21
+
22
+
23
+ #
24
+ # Mapper for VaultPatchParameters class as Ruby Hash.
25
+ # This will be used for serialization/deserialization.
26
+ #
27
+ def self.mapper()
28
+ {
29
+ client_side_validation: true,
30
+ required: false,
31
+ serialized_name: 'VaultPatchParameters',
32
+ type: {
33
+ name: 'Composite',
34
+ class_name: 'VaultPatchParameters',
35
+ model_properties: {
36
+ tags: {
37
+ client_side_validation: true,
38
+ required: false,
39
+ serialized_name: 'tags',
40
+ type: {
41
+ name: 'Dictionary',
42
+ value: {
43
+ client_side_validation: true,
44
+ required: false,
45
+ serialized_name: 'StringElementType',
46
+ type: {
47
+ name: 'String'
48
+ }
49
+ }
50
+ }
51
+ },
52
+ properties: {
53
+ client_side_validation: true,
54
+ required: false,
55
+ serialized_name: 'properties',
56
+ type: {
57
+ name: 'Composite',
58
+ class_name: 'VaultPatchProperties'
59
+ }
60
+ }
61
+ }
62
+ }
63
+ }
64
+ end
65
+ end
66
+ end
67
+ end
@@ -0,0 +1,145 @@
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::V2016_10_01
7
+ module Models
8
+ #
9
+ # Properties of the vault
10
+ #
11
+ class VaultPatchProperties
12
+
13
+ include MsRestAzure
14
+
15
+ # @return The Azure Active Directory tenant ID that should be used for
16
+ # authenticating requests to the key vault.
17
+ attr_accessor :tenant_id
18
+
19
+ # @return [Sku] SKU details
20
+ attr_accessor :sku
21
+
22
+ # @return [Array<AccessPolicyEntry>] An array of 0 to 16 identities that
23
+ # have access to the key vault. All identities in the array must use the
24
+ # same tenant ID as the key vault's tenant ID.
25
+ attr_accessor :access_policies
26
+
27
+ # @return [Boolean] Property to specify whether Azure Virtual Machines
28
+ # are permitted to retrieve certificates stored as secrets from the key
29
+ # vault.
30
+ attr_accessor :enabled_for_deployment
31
+
32
+ # @return [Boolean] Property to specify whether Azure Disk Encryption is
33
+ # permitted to retrieve secrets from the vault and unwrap keys.
34
+ attr_accessor :enabled_for_disk_encryption
35
+
36
+ # @return [Boolean] Property to specify whether Azure Resource Manager is
37
+ # permitted to retrieve secrets from the key vault.
38
+ attr_accessor :enabled_for_template_deployment
39
+
40
+ # @return [Boolean] Property to specify whether the 'soft delete'
41
+ # functionality is enabled for this key vault. It does not accept false
42
+ # value.
43
+ attr_accessor :enable_soft_delete
44
+
45
+ # @return [CreateMode] The vault's create mode to indicate whether the
46
+ # vault need to be recovered or not. Possible values include: 'recover',
47
+ # 'default'
48
+ attr_accessor :create_mode
49
+
50
+
51
+ #
52
+ # Mapper for VaultPatchProperties class as Ruby Hash.
53
+ # This will be used for serialization/deserialization.
54
+ #
55
+ def self.mapper()
56
+ {
57
+ client_side_validation: true,
58
+ required: false,
59
+ serialized_name: 'VaultPatchProperties',
60
+ type: {
61
+ name: 'Composite',
62
+ class_name: 'VaultPatchProperties',
63
+ model_properties: {
64
+ tenant_id: {
65
+ client_side_validation: true,
66
+ required: false,
67
+ serialized_name: 'tenantId',
68
+ type: {
69
+ name: 'String'
70
+ }
71
+ },
72
+ sku: {
73
+ client_side_validation: true,
74
+ required: false,
75
+ serialized_name: 'sku',
76
+ type: {
77
+ name: 'Composite',
78
+ class_name: 'Sku'
79
+ }
80
+ },
81
+ access_policies: {
82
+ client_side_validation: true,
83
+ required: false,
84
+ serialized_name: 'accessPolicies',
85
+ type: {
86
+ name: 'Sequence',
87
+ element: {
88
+ client_side_validation: true,
89
+ required: false,
90
+ serialized_name: 'AccessPolicyEntryElementType',
91
+ type: {
92
+ name: 'Composite',
93
+ class_name: 'AccessPolicyEntry'
94
+ }
95
+ }
96
+ }
97
+ },
98
+ enabled_for_deployment: {
99
+ client_side_validation: true,
100
+ required: false,
101
+ serialized_name: 'enabledForDeployment',
102
+ type: {
103
+ name: 'Boolean'
104
+ }
105
+ },
106
+ enabled_for_disk_encryption: {
107
+ client_side_validation: true,
108
+ required: false,
109
+ serialized_name: 'enabledForDiskEncryption',
110
+ type: {
111
+ name: 'Boolean'
112
+ }
113
+ },
114
+ enabled_for_template_deployment: {
115
+ client_side_validation: true,
116
+ required: false,
117
+ serialized_name: 'enabledForTemplateDeployment',
118
+ type: {
119
+ name: 'Boolean'
120
+ }
121
+ },
122
+ enable_soft_delete: {
123
+ client_side_validation: true,
124
+ required: false,
125
+ serialized_name: 'enableSoftDelete',
126
+ type: {
127
+ name: 'Boolean'
128
+ }
129
+ },
130
+ create_mode: {
131
+ client_side_validation: true,
132
+ required: false,
133
+ serialized_name: 'createMode',
134
+ type: {
135
+ name: 'Enum',
136
+ module: 'CreateMode'
137
+ }
138
+ }
139
+ }
140
+ }
141
+ }
142
+ end
143
+ end
144
+ end
145
+ end
@@ -87,9 +87,6 @@ module Azure::KeyVault::Mgmt::V2016_10_01
87
87
  client_side_validation: true,
88
88
  required: false,
89
89
  serialized_name: 'accessPolicies',
90
- constraints: {
91
- MaxItems: 16
92
- },
93
90
  type: {
94
91
  name: 'Sequence',
95
92
  element: {
@@ -106,6 +103,7 @@ module Azure::KeyVault::Mgmt::V2016_10_01
106
103
  vault_uri: {
107
104
  client_side_validation: true,
108
105
  required: false,
106
+ read_only: true,
109
107
  serialized_name: 'vaultUri',
110
108
  type: {
111
109
  name: 'String'
@@ -0,0 +1,216 @@
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::V2016_10_01
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
+ # Deserialize Response
91
+ if status_code == 200
92
+ begin
93
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
94
+ result_mapper = Azure::KeyVault::Mgmt::V2016_10_01::Models::OperationListResult.mapper()
95
+ result.body = @client.deserialize(result_mapper, parsed_response)
96
+ rescue Exception => e
97
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
98
+ end
99
+ end
100
+
101
+ result
102
+ end
103
+
104
+ promise.execute
105
+ end
106
+
107
+ #
108
+ # Lists all of the available Key Vault Rest API operations.
109
+ #
110
+ # @param next_page_link [String] The NextLink from the previous successful call
111
+ # to List operation.
112
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
113
+ # will be added to the HTTP request.
114
+ #
115
+ # @return [OperationListResult] operation results.
116
+ #
117
+ def list_next(next_page_link, custom_headers:nil)
118
+ response = list_next_async(next_page_link, custom_headers:custom_headers).value!
119
+ response.body unless response.nil?
120
+ end
121
+
122
+ #
123
+ # Lists all of the available Key Vault Rest API operations.
124
+ #
125
+ # @param next_page_link [String] The NextLink from the previous successful call
126
+ # to List operation.
127
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
128
+ # will be added to the HTTP request.
129
+ #
130
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
131
+ #
132
+ def list_next_with_http_info(next_page_link, custom_headers:nil)
133
+ list_next_async(next_page_link, custom_headers:custom_headers).value!
134
+ end
135
+
136
+ #
137
+ # Lists all of the available Key Vault Rest API operations.
138
+ #
139
+ # @param next_page_link [String] The NextLink from the previous successful call
140
+ # to List operation.
141
+ # @param [Hash{String => String}] A hash of custom headers that will be added
142
+ # to the HTTP request.
143
+ #
144
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
145
+ #
146
+ def list_next_async(next_page_link, custom_headers:nil)
147
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
148
+
149
+
150
+ request_headers = {}
151
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
152
+
153
+ # Set Headers
154
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
155
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
156
+ path_template = '{nextLink}'
157
+
158
+ request_url = @base_url || @client.base_url
159
+
160
+ options = {
161
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
162
+ skip_encoding_path_params: {'nextLink' => next_page_link},
163
+ headers: request_headers.merge(custom_headers || {}),
164
+ base_url: request_url
165
+ }
166
+ promise = @client.make_request_async(:get, path_template, options)
167
+
168
+ promise = promise.then do |result|
169
+ http_response = result.response
170
+ status_code = http_response.status
171
+ response_content = http_response.body
172
+ unless status_code == 200
173
+ error_model = JSON.load(response_content)
174
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
175
+ end
176
+
177
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
178
+ # Deserialize Response
179
+ if status_code == 200
180
+ begin
181
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
182
+ result_mapper = Azure::KeyVault::Mgmt::V2016_10_01::Models::OperationListResult.mapper()
183
+ result.body = @client.deserialize(result_mapper, parsed_response)
184
+ rescue Exception => e
185
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
186
+ end
187
+ end
188
+
189
+ result
190
+ end
191
+
192
+ promise.execute
193
+ end
194
+
195
+ #
196
+ # Lists all of the available Key Vault Rest API operations.
197
+ #
198
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
199
+ # will be added to the HTTP request.
200
+ #
201
+ # @return [OperationListResult] which provide lazy access to pages of the
202
+ # response.
203
+ #
204
+ def list_as_lazy(custom_headers:nil)
205
+ response = list_async(custom_headers:custom_headers).value!
206
+ unless response.nil?
207
+ page = response.body
208
+ page.next_method = Proc.new do |next_page_link|
209
+ list_next_async(next_page_link, custom_headers:custom_headers)
210
+ end
211
+ page
212
+ end
213
+ end
214
+
215
+ end
216
+ end