azure_mgmt_storage 0.2.1 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. checksums.yaml +13 -5
  2. data/README.md +8 -31
  3. data/azure_mgmt_storage.gemspec +2 -2
  4. data/lib/azure_mgmt_storage.rb +14 -5
  5. data/lib/azure_mgmt_storage/models/access_tier.rb +16 -0
  6. data/lib/azure_mgmt_storage/models/account_status.rb +1 -1
  7. data/lib/azure_mgmt_storage/models/check_name_availability_result.rb +1 -1
  8. data/lib/azure_mgmt_storage/models/custom_domain.rb +1 -1
  9. data/lib/azure_mgmt_storage/models/encryption.rb +73 -0
  10. data/lib/azure_mgmt_storage/models/encryption_service.rb +72 -0
  11. data/lib/azure_mgmt_storage/models/{storage_account_keys.rb → encryption_services.rb} +18 -21
  12. data/lib/azure_mgmt_storage/models/endpoints.rb +1 -1
  13. data/lib/azure_mgmt_storage/models/key_permission.rb +16 -0
  14. data/lib/azure_mgmt_storage/models/kind.rb +16 -0
  15. data/lib/azure_mgmt_storage/models/provisioning_state.rb +1 -1
  16. data/lib/azure_mgmt_storage/models/reason.rb +1 -1
  17. data/lib/azure_mgmt_storage/models/sku.rb +77 -0
  18. data/lib/azure_mgmt_storage/models/{account_type.rb → sku_name.rb} +4 -4
  19. data/lib/azure_mgmt_storage/models/sku_tier.rb +16 -0
  20. data/lib/azure_mgmt_storage/models/storage_account.rb +31 -1
  21. data/lib/azure_mgmt_storage/models/storage_account_check_name_availability_parameters.rb +2 -1
  22. data/lib/azure_mgmt_storage/models/storage_account_create_parameters.rb +43 -3
  23. data/lib/azure_mgmt_storage/models/storage_account_key.rb +78 -0
  24. data/lib/azure_mgmt_storage/models/storage_account_list_keys_result.rb +77 -0
  25. data/lib/azure_mgmt_storage/models/storage_account_list_result.rb +1 -1
  26. data/lib/azure_mgmt_storage/models/storage_account_properties.rb +34 -16
  27. data/lib/azure_mgmt_storage/models/storage_account_properties_create_parameters.rb +50 -12
  28. data/lib/azure_mgmt_storage/models/storage_account_properties_update_parameters.rb +34 -18
  29. data/lib/azure_mgmt_storage/models/storage_account_regenerate_key_parameters.rb +1 -1
  30. data/lib/azure_mgmt_storage/models/storage_account_update_parameters.rb +25 -3
  31. data/lib/azure_mgmt_storage/models/usage.rb +1 -5
  32. data/lib/azure_mgmt_storage/models/usage_list_result.rb +1 -1
  33. data/lib/azure_mgmt_storage/models/usage_name.rb +1 -1
  34. data/lib/azure_mgmt_storage/models/usage_unit.rb +1 -1
  35. data/lib/azure_mgmt_storage/module_definition.rb +1 -1
  36. data/lib/azure_mgmt_storage/storage_accounts.rb +450 -100
  37. data/lib/azure_mgmt_storage/storage_management_client.rb +2 -2
  38. data/lib/azure_mgmt_storage/usage_operations.rb +35 -6
  39. data/lib/azure_mgmt_storage/version.rb +2 -2
  40. metadata +42 -26
@@ -1,5 +1,5 @@
1
1
  # encoding: utf-8
2
- # Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0
2
+ # Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
3
3
  # Changes may cause incorrect behavior and will be lost if the code is
4
4
  # regenerated.
5
5
 
@@ -0,0 +1,77 @@
1
+ # encoding: utf-8
2
+ # Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
3
+ # Changes may cause incorrect behavior and will be lost if the code is
4
+ # regenerated.
5
+
6
+ module Azure::ARM::Storage
7
+ module Models
8
+ #
9
+ # The SKU of the storage account.
10
+ #
11
+ class Sku
12
+
13
+ include MsRestAzure
14
+
15
+ # @return [SkuName] Gets or sets the sku name. Required for account
16
+ # creation, optional for update. Note that in older versions, sku name
17
+ # was called accountType. Possible values include: 'Standard_LRS',
18
+ # 'Standard_GRS', 'Standard_RAGRS', 'Standard_ZRS', 'Premium_LRS'
19
+ attr_accessor :name
20
+
21
+ # @return [SkuTier] Gets the sku tier. This is based on the SKU name.
22
+ # Possible values include: 'Standard', 'Premium'
23
+ attr_accessor :tier
24
+
25
+ #
26
+ # Validate the object. Throws ValidationError if validation fails.
27
+ #
28
+ def validate
29
+ fail MsRest::ValidationError, 'property name is nil' if @name.nil?
30
+ end
31
+
32
+ #
33
+ # Serializes given Model object into Ruby Hash.
34
+ # @param object Model object to serialize.
35
+ # @return [Hash] Serialized object in form of Ruby Hash.
36
+ #
37
+ def self.serialize_object(object)
38
+ object.validate
39
+ output_object = {}
40
+
41
+ serialized_property = object.name
42
+ output_object['name'] = serialized_property unless serialized_property.nil?
43
+
44
+ serialized_property = object.tier
45
+ output_object['tier'] = serialized_property unless serialized_property.nil?
46
+
47
+ output_object
48
+ end
49
+
50
+ #
51
+ # Deserializes given Ruby Hash into Model object.
52
+ # @param object [Hash] Ruby Hash object to deserialize.
53
+ # @return [Sku] Deserialized object.
54
+ #
55
+ def self.deserialize_object(object)
56
+ return if object.nil?
57
+ output_object = Sku.new
58
+
59
+ deserialized_property = object['name']
60
+ if (!deserialized_property.nil? && !deserialized_property.empty?)
61
+ enum_is_valid = SkuName.constants.any? { |e| SkuName.const_get(e).to_s.downcase == deserialized_property.downcase }
62
+ warn 'Enum SkuName does not contain ' + deserialized_property.downcase + ', but was received from the server.' unless enum_is_valid
63
+ end
64
+ output_object.name = deserialized_property
65
+
66
+ deserialized_property = object['tier']
67
+ if (!deserialized_property.nil? && !deserialized_property.empty?)
68
+ enum_is_valid = SkuTier.constants.any? { |e| SkuTier.const_get(e).to_s.downcase == deserialized_property.downcase }
69
+ warn 'Enum SkuTier does not contain ' + deserialized_property.downcase + ', but was received from the server.' unless enum_is_valid
70
+ end
71
+ output_object.tier = deserialized_property
72
+
73
+ output_object
74
+ end
75
+ end
76
+ end
77
+ end
@@ -1,18 +1,18 @@
1
1
  # encoding: utf-8
2
- # Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0
2
+ # Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
3
3
  # Changes may cause incorrect behavior and will be lost if the code is
4
4
  # regenerated.
5
5
 
6
6
  module Azure::ARM::Storage
7
7
  module Models
8
8
  #
9
- # Defines values for AccountType
9
+ # Defines values for SkuName
10
10
  #
11
- module AccountType
11
+ module SkuName
12
12
  StandardLRS = "Standard_LRS"
13
- StandardZRS = "Standard_ZRS"
14
13
  StandardGRS = "Standard_GRS"
15
14
  StandardRAGRS = "Standard_RAGRS"
15
+ StandardZRS = "Standard_ZRS"
16
16
  PremiumLRS = "Premium_LRS"
17
17
  end
18
18
  end
@@ -0,0 +1,16 @@
1
+ # encoding: utf-8
2
+ # Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
3
+ # Changes may cause incorrect behavior and will be lost if the code is
4
+ # regenerated.
5
+
6
+ module Azure::ARM::Storage
7
+ module Models
8
+ #
9
+ # Defines values for SkuTier
10
+ #
11
+ module SkuTier
12
+ Standard = "Standard"
13
+ Premium = "Premium"
14
+ end
15
+ end
16
+ end
@@ -1,5 +1,5 @@
1
1
  # encoding: utf-8
2
- # Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0
2
+ # Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
3
3
  # Changes may cause incorrect behavior and will be lost if the code is
4
4
  # regenerated.
5
5
 
@@ -12,6 +12,13 @@ module Azure::ARM::Storage
12
12
 
13
13
  include MsRestAzure
14
14
 
15
+ # @return [Sku] Gets the SKU.
16
+ attr_accessor :sku
17
+
18
+ # @return [Kind] Gets the Kind. Possible values include: 'Storage',
19
+ # 'BlobStorage'
20
+ attr_accessor :kind
21
+
15
22
  # @return [StorageAccountProperties]
16
23
  attr_accessor :properties
17
24
 
@@ -19,6 +26,7 @@ module Azure::ARM::Storage
19
26
  # Validate the object. Throws ValidationError if validation fails.
20
27
  #
21
28
  def validate
29
+ @sku.validate unless @sku.nil?
22
30
  @properties.validate unless @properties.nil?
23
31
  end
24
32
 
@@ -46,6 +54,15 @@ module Azure::ARM::Storage
46
54
  serialized_property = object.tags
47
55
  output_object['tags'] = serialized_property unless serialized_property.nil?
48
56
 
57
+ serialized_property = object.sku
58
+ unless serialized_property.nil?
59
+ serialized_property = Sku.serialize_object(serialized_property)
60
+ end
61
+ output_object['sku'] = serialized_property unless serialized_property.nil?
62
+
63
+ serialized_property = object.kind
64
+ output_object['kind'] = serialized_property unless serialized_property.nil?
65
+
49
66
  serialized_property = object.properties
50
67
  unless serialized_property.nil?
51
68
  serialized_property = StorageAccountProperties.serialize_object(serialized_property)
@@ -79,6 +96,19 @@ module Azure::ARM::Storage
79
96
  deserialized_property = object['tags']
80
97
  output_object.tags = deserialized_property
81
98
 
99
+ deserialized_property = object['sku']
100
+ unless deserialized_property.nil?
101
+ deserialized_property = Sku.deserialize_object(deserialized_property)
102
+ end
103
+ output_object.sku = deserialized_property
104
+
105
+ deserialized_property = object['kind']
106
+ if (!deserialized_property.nil? && !deserialized_property.empty?)
107
+ enum_is_valid = Kind.constants.any? { |e| Kind.const_get(e).to_s.downcase == deserialized_property.downcase }
108
+ warn 'Enum Kind does not contain ' + deserialized_property.downcase + ', but was received from the server.' unless enum_is_valid
109
+ end
110
+ output_object.kind = deserialized_property
111
+
82
112
  deserialized_property = object['properties']
83
113
  unless deserialized_property.nil?
84
114
  deserialized_property = StorageAccountProperties.deserialize_object(deserialized_property)
@@ -1,5 +1,5 @@
1
1
  # encoding: utf-8
2
- # Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0
2
+ # Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
3
3
  # Changes may cause incorrect behavior and will be lost if the code is
4
4
  # regenerated.
5
5
 
@@ -23,6 +23,7 @@ module Azure::ARM::Storage
23
23
  #
24
24
  def validate
25
25
  fail MsRest::ValidationError, 'property name is nil' if @name.nil?
26
+ fail MsRest::ValidationError, 'property type is nil' if @type.nil?
26
27
  end
27
28
 
28
29
  #
@@ -1,5 +1,5 @@
1
1
  # encoding: utf-8
2
- # Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0
2
+ # Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
3
3
  # Changes may cause incorrect behavior and will be lost if the code is
4
4
  # regenerated.
5
5
 
@@ -12,10 +12,25 @@ module Azure::ARM::Storage
12
12
 
13
13
  include MsRestAzure
14
14
 
15
- # @return [String] Resource location
15
+ # @return [Sku] Required. Gets or sets the sku type.
16
+ attr_accessor :sku
17
+
18
+ # @return [Kind] Required. Indicates the type of storage account.
19
+ # Possible values include: 'Storage', 'BlobStorage'
20
+ attr_accessor :kind
21
+
22
+ # @return [String] Required. Gets or sets the location of the resource.
23
+ # This will be one of the supported and registered Azure Geo Regions
24
+ # (e.g. West US, East US, Southeast Asia, etc.). The geo region of a
25
+ # resource cannot be changed once it is created, but if an identical
26
+ # geo region is specified on update the request will succeed.
16
27
  attr_accessor :location
17
28
 
18
- # @return [Hash{String => String}] Resource tags
29
+ # @return [Hash{String => String}] Gets or sets a list of key value
30
+ # pairs that describe the resource. These tags can be used in viewing
31
+ # and grouping this resource (across resource groups). A maximum of 15
32
+ # tags can be provided for a resource. Each tag must have a key no
33
+ # greater than 128 characters and value no greater than 256 characters.
19
34
  attr_accessor :tags
20
35
 
21
36
  # @return [StorageAccountPropertiesCreateParameters]
@@ -25,7 +40,10 @@ module Azure::ARM::Storage
25
40
  # Validate the object. Throws ValidationError if validation fails.
26
41
  #
27
42
  def validate
43
+ fail MsRest::ValidationError, 'property sku is nil' if @sku.nil?
44
+ fail MsRest::ValidationError, 'property kind is nil' if @kind.nil?
28
45
  fail MsRest::ValidationError, 'property location is nil' if @location.nil?
46
+ @sku.validate unless @sku.nil?
29
47
  @tags.each{ |e| e.validate if e.respond_to?(:validate) } unless @tags.nil?
30
48
  @properties.validate unless @properties.nil?
31
49
  end
@@ -39,6 +57,15 @@ module Azure::ARM::Storage
39
57
  object.validate
40
58
  output_object = {}
41
59
 
60
+ serialized_property = object.sku
61
+ unless serialized_property.nil?
62
+ serialized_property = Sku.serialize_object(serialized_property)
63
+ end
64
+ output_object['sku'] = serialized_property unless serialized_property.nil?
65
+
66
+ serialized_property = object.kind
67
+ output_object['kind'] = serialized_property unless serialized_property.nil?
68
+
42
69
  serialized_property = object.location
43
70
  output_object['location'] = serialized_property unless serialized_property.nil?
44
71
 
@@ -63,6 +90,19 @@ module Azure::ARM::Storage
63
90
  return if object.nil?
64
91
  output_object = StorageAccountCreateParameters.new
65
92
 
93
+ deserialized_property = object['sku']
94
+ unless deserialized_property.nil?
95
+ deserialized_property = Sku.deserialize_object(deserialized_property)
96
+ end
97
+ output_object.sku = deserialized_property
98
+
99
+ deserialized_property = object['kind']
100
+ if (!deserialized_property.nil? && !deserialized_property.empty?)
101
+ enum_is_valid = Kind.constants.any? { |e| Kind.const_get(e).to_s.downcase == deserialized_property.downcase }
102
+ warn 'Enum Kind does not contain ' + deserialized_property.downcase + ', but was received from the server.' unless enum_is_valid
103
+ end
104
+ output_object.kind = deserialized_property
105
+
66
106
  deserialized_property = object['location']
67
107
  output_object.location = deserialized_property
68
108
 
@@ -0,0 +1,78 @@
1
+ # encoding: utf-8
2
+ # Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
3
+ # Changes may cause incorrect behavior and will be lost if the code is
4
+ # regenerated.
5
+
6
+ module Azure::ARM::Storage
7
+ module Models
8
+ #
9
+ # An access key for the storage account.
10
+ #
11
+ class StorageAccountKey
12
+
13
+ include MsRestAzure
14
+
15
+ # @return [String] Name of the key.
16
+ attr_accessor :key_name
17
+
18
+ # @return [String] Base 64 encoded value of the key.
19
+ attr_accessor :value
20
+
21
+ # @return [KeyPermission] Permissions for the key. Possible values
22
+ # include: 'READ', 'FULL'
23
+ attr_accessor :permissions
24
+
25
+ #
26
+ # Validate the object. Throws ValidationError if validation fails.
27
+ #
28
+ def validate
29
+ end
30
+
31
+ #
32
+ # Serializes given Model object into Ruby Hash.
33
+ # @param object Model object to serialize.
34
+ # @return [Hash] Serialized object in form of Ruby Hash.
35
+ #
36
+ def self.serialize_object(object)
37
+ object.validate
38
+ output_object = {}
39
+
40
+ serialized_property = object.key_name
41
+ output_object['keyName'] = serialized_property unless serialized_property.nil?
42
+
43
+ serialized_property = object.value
44
+ output_object['value'] = serialized_property unless serialized_property.nil?
45
+
46
+ serialized_property = object.permissions
47
+ output_object['permissions'] = serialized_property unless serialized_property.nil?
48
+
49
+ output_object
50
+ end
51
+
52
+ #
53
+ # Deserializes given Ruby Hash into Model object.
54
+ # @param object [Hash] Ruby Hash object to deserialize.
55
+ # @return [StorageAccountKey] Deserialized object.
56
+ #
57
+ def self.deserialize_object(object)
58
+ return if object.nil?
59
+ output_object = StorageAccountKey.new
60
+
61
+ deserialized_property = object['keyName']
62
+ output_object.key_name = deserialized_property
63
+
64
+ deserialized_property = object['value']
65
+ output_object.value = deserialized_property
66
+
67
+ deserialized_property = object['permissions']
68
+ if (!deserialized_property.nil? && !deserialized_property.empty?)
69
+ enum_is_valid = KeyPermission.constants.any? { |e| KeyPermission.const_get(e).to_s.downcase == deserialized_property.downcase }
70
+ warn 'Enum KeyPermission does not contain ' + deserialized_property.downcase + ', but was received from the server.' unless enum_is_valid
71
+ end
72
+ output_object.permissions = deserialized_property
73
+
74
+ output_object
75
+ end
76
+ end
77
+ end
78
+ end
@@ -0,0 +1,77 @@
1
+ # encoding: utf-8
2
+ # Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
3
+ # Changes may cause incorrect behavior and will be lost if the code is
4
+ # regenerated.
5
+
6
+ module Azure::ARM::Storage
7
+ module Models
8
+ #
9
+ # The ListKeys operation response.
10
+ #
11
+ class StorageAccountListKeysResult
12
+
13
+ include MsRestAzure
14
+
15
+ # @return [Array<StorageAccountKey>] Gets the list of account keys and
16
+ # their properties.
17
+ attr_accessor :keys
18
+
19
+ #
20
+ # Validate the object. Throws ValidationError if validation fails.
21
+ #
22
+ def validate
23
+ @keys.each{ |e| e.validate if e.respond_to?(:validate) } unless @keys.nil?
24
+ end
25
+
26
+ #
27
+ # Serializes given Model object into Ruby Hash.
28
+ # @param object Model object to serialize.
29
+ # @return [Hash] Serialized object in form of Ruby Hash.
30
+ #
31
+ def self.serialize_object(object)
32
+ object.validate
33
+ output_object = {}
34
+
35
+ serialized_property = object.keys
36
+ unless serialized_property.nil?
37
+ serializedArray = []
38
+ serialized_property.each do |element|
39
+ unless element.nil?
40
+ element = StorageAccountKey.serialize_object(element)
41
+ end
42
+ serializedArray.push(element)
43
+ end
44
+ serialized_property = serializedArray
45
+ end
46
+ output_object['keys'] = serialized_property unless serialized_property.nil?
47
+
48
+ output_object
49
+ end
50
+
51
+ #
52
+ # Deserializes given Ruby Hash into Model object.
53
+ # @param object [Hash] Ruby Hash object to deserialize.
54
+ # @return [StorageAccountListKeysResult] Deserialized object.
55
+ #
56
+ def self.deserialize_object(object)
57
+ return if object.nil?
58
+ output_object = StorageAccountListKeysResult.new
59
+
60
+ deserialized_property = object['keys']
61
+ unless deserialized_property.nil?
62
+ deserialized_array = []
63
+ deserialized_property.each do |element1|
64
+ unless element1.nil?
65
+ element1 = StorageAccountKey.deserialize_object(element1)
66
+ end
67
+ deserialized_array.push(element1)
68
+ end
69
+ deserialized_property = deserialized_array
70
+ end
71
+ output_object.keys = deserialized_property
72
+
73
+ output_object
74
+ end
75
+ end
76
+ end
77
+ end
@@ -1,5 +1,5 @@
1
1
  # encoding: utf-8
2
- # Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0
2
+ # Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
3
3
  # Changes may cause incorrect behavior and will be lost if the code is
4
4
  # regenerated.
5
5