azure_mgmt_storage 0.2.1 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
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
checksums.yaml CHANGED
@@ -1,7 +1,15 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 0934526b150ef541da3fa78aaed19bb48b7368ca
4
- data.tar.gz: b8fb9afe3634888e89ba5df4cd18f93dd066893d
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ MjkwMThkYTM4MjE5ZTAwMGVmNjAzZDU4YWFkNzA1ZTBkOGZjNzM0Ng==
5
+ data.tar.gz: !binary |-
6
+ Y2YxYzRhZjBkNjQ3ZjdhYThiOTYwY2FhZmZhODg4MjcxYTUxYTE3Mg==
5
7
  SHA512:
6
- metadata.gz: 97ef094be8836485c16ee754553aa653e471fbf46d5de32783146750750cfb0009ce04df44f9af4d821bb940731707b75c242d49e31e8109a436c049a2390472
7
- data.tar.gz: 87a549938060eb10760610a9aa602af923f3560c25db53bdea806da3711f4b227dfbd7b4ab7bee361ac49d0cce06974a70d20ec9aadbe0ca720cb13be63c8af6
8
+ metadata.gz: !binary |-
9
+ YmYyZTczZDAzY2JjNzk1NDMyMDRjNzQ2NmJhMmY4MjRmM2U1MzEwYjM4M2Iw
10
+ MzhmYWFiMjkxYjJiMzc5YTliMTUzZjJjOTY5ZjhkOTQzMjNjNTU4YTA3OWQ1
11
+ ZWMwYjI2M2I2YzY2MjRjOGExNzA4MWU0MGQ0NjFiZTEwNDZiZWY=
12
+ data.tar.gz: !binary |-
13
+ MDAwOTc0Yjg0NTFmMDhmMDM3NThiZTdlMTJmM2Y3NTc1YzNhZGQ4ZWY2MTZj
14
+ NjJhYjUxNzRhOWUxNTZjNGQwNjVkZjRkNzIzZmJlMzk4ZWM1YTJiODI5ZDA5
15
+ MzJmYTcwOTBjYjZlMTBlMDg0MWQxOTM2OTM0YzYzNDNmODdiODM=
data/README.md CHANGED
@@ -48,12 +48,15 @@ client = Azure::ARM::Storage::StorageManagementClient.new(credentials)
48
48
  client.subscription_id = subscription_id
49
49
 
50
50
  # Create a model for new storage account.
51
- properties = Azure::ARM::Storage::Models::StorageAccountPropertiesCreateParameters.new
52
- properties.account_type = 'Standard_LRS'
51
+ props = Models::StorageAccountPropertiesCreateParameters.new
53
52
 
54
- params = Azure::ARM::Storage::Models::StorageAccountCreateParameters.new
55
- params.properties = properties
53
+ params = Models::StorageAccountCreateParameters.new
54
+ params.properties = props
56
55
  params.location = 'westus'
56
+ sku = Models::Sku.new
57
+ sku.name = 'Standard_LRS'
58
+ params.sku = sku
59
+ params.kind = Models::Kind::Storage
57
60
 
58
61
  promise = client.storage_accounts.create('some_existing_resource_group', 'newstorageaccount', params)
59
62
  ```
@@ -78,34 +81,8 @@ In both cases you're returned an instance of MsRestAzure::AzureOperationResponse
78
81
  storage_account = result.body
79
82
 
80
83
  p storage_account.location
81
- p storage_account.properties.account_type
84
+ p storage_account.sku.name
82
85
  ```
83
86
 
84
87
  Congrats, you've create new storage account. We encourage you to try more stuff and let us know your feedback!
85
88
  For advanced SDK usage please reference to the spec file storage_management_spec.rb.
86
-
87
- # Running tests
88
-
89
- ## Adding env variables
90
-
91
- To run the tests you would need to set the following environment variables with your real Azure data:
92
-
93
- * AZURE_TENANT_ID="your tenant id or domain"
94
- * AZURE_CLIENT_ID="your client id / application id"
95
- * AZURE_CLIENT_SECRET="your service principal secret"
96
- * AZURE_SUBSCRIPTION_ID="your subscription id"
97
-
98
- * run_long_tasks - set this to '1' only if you would like to run time consuming tests like VM creation.
99
-
100
- ## Starting tests
101
-
102
- Just run 'rspec' command from the current gem folder.
103
-
104
- # Contribution
105
-
106
- All the SDK code was generated by tool 'AutoRest' - https://github.com/Azure/autorest
107
- So if you have found a bug or have an idea for a new feature - suggest, discuss and contribute it into the AutoRest repository. After that SDK maintainers will update the sources and the gem.
108
-
109
- # Provide feedback
110
-
111
- Send email to the azsdkteam@microsoft.com or file new issue in this repository.
@@ -29,7 +29,7 @@ Gem::Specification.new do |spec|
29
29
  spec.add_development_dependency 'rake', '~> 10'
30
30
  spec.add_development_dependency 'rspec', '~> 3'
31
31
  spec.add_development_dependency 'dotenv', '~> 2'
32
- spec.add_development_dependency 'azure_mgmt_resources', '~> 0.2'
32
+ spec.add_development_dependency 'azure_mgmt_resources', '~> 0.3'
33
33
 
34
- spec.add_runtime_dependency 'ms_rest_azure', '~> 0.2.0'
34
+ spec.add_runtime_dependency 'ms_rest_azure', '~> 0.2.3'
35
35
  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
 
@@ -27,24 +27,33 @@ module Azure::ARM::Storage
27
27
  module Models
28
28
  autoload :StorageAccountCheckNameAvailabilityParameters, 'azure_mgmt_storage/models/storage_account_check_name_availability_parameters.rb'
29
29
  autoload :CheckNameAvailabilityResult, 'azure_mgmt_storage/models/check_name_availability_result.rb'
30
+ autoload :Sku, 'azure_mgmt_storage/models/sku.rb'
31
+ autoload :CustomDomain, 'azure_mgmt_storage/models/custom_domain.rb'
32
+ autoload :EncryptionService, 'azure_mgmt_storage/models/encryption_service.rb'
33
+ autoload :EncryptionServices, 'azure_mgmt_storage/models/encryption_services.rb'
34
+ autoload :Encryption, 'azure_mgmt_storage/models/encryption.rb'
30
35
  autoload :StorageAccountPropertiesCreateParameters, 'azure_mgmt_storage/models/storage_account_properties_create_parameters.rb'
31
36
  autoload :StorageAccountCreateParameters, 'azure_mgmt_storage/models/storage_account_create_parameters.rb'
32
37
  autoload :Endpoints, 'azure_mgmt_storage/models/endpoints.rb'
33
- autoload :CustomDomain, 'azure_mgmt_storage/models/custom_domain.rb'
34
38
  autoload :StorageAccountProperties, 'azure_mgmt_storage/models/storage_account_properties.rb'
35
- autoload :StorageAccountKeys, 'azure_mgmt_storage/models/storage_account_keys.rb'
39
+ autoload :StorageAccountKey, 'azure_mgmt_storage/models/storage_account_key.rb'
36
40
  autoload :StorageAccountListResult, 'azure_mgmt_storage/models/storage_account_list_result.rb'
41
+ autoload :StorageAccountListKeysResult, 'azure_mgmt_storage/models/storage_account_list_keys_result.rb'
42
+ autoload :StorageAccountRegenerateKeyParameters, 'azure_mgmt_storage/models/storage_account_regenerate_key_parameters.rb'
37
43
  autoload :StorageAccountPropertiesUpdateParameters, 'azure_mgmt_storage/models/storage_account_properties_update_parameters.rb'
38
44
  autoload :StorageAccountUpdateParameters, 'azure_mgmt_storage/models/storage_account_update_parameters.rb'
39
- autoload :StorageAccountRegenerateKeyParameters, 'azure_mgmt_storage/models/storage_account_regenerate_key_parameters.rb'
40
45
  autoload :UsageName, 'azure_mgmt_storage/models/usage_name.rb'
41
46
  autoload :Usage, 'azure_mgmt_storage/models/usage.rb'
42
47
  autoload :UsageListResult, 'azure_mgmt_storage/models/usage_list_result.rb'
43
48
  autoload :StorageAccount, 'azure_mgmt_storage/models/storage_account.rb'
44
49
  autoload :Reason, 'azure_mgmt_storage/models/reason.rb'
45
- autoload :AccountType, 'azure_mgmt_storage/models/account_type.rb'
50
+ autoload :SkuName, 'azure_mgmt_storage/models/sku_name.rb'
51
+ autoload :SkuTier, 'azure_mgmt_storage/models/sku_tier.rb'
52
+ autoload :AccessTier, 'azure_mgmt_storage/models/access_tier.rb'
53
+ autoload :Kind, 'azure_mgmt_storage/models/kind.rb'
46
54
  autoload :ProvisioningState, 'azure_mgmt_storage/models/provisioning_state.rb'
47
55
  autoload :AccountStatus, 'azure_mgmt_storage/models/account_status.rb'
56
+ autoload :KeyPermission, 'azure_mgmt_storage/models/key_permission.rb'
48
57
  autoload :UsageUnit, 'azure_mgmt_storage/models/usage_unit.rb'
49
58
  end
50
59
  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 AccessTier
10
+ #
11
+ module AccessTier
12
+ Hot = "Hot"
13
+ Cool = "Cool"
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
 
@@ -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
 
@@ -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,73 @@
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 encryption settings on the account.
10
+ #
11
+ class Encryption
12
+
13
+ include MsRestAzure
14
+
15
+ # @return [EncryptionServices] Gets the services which are encrypted.
16
+ attr_accessor :services
17
+
18
+ # @return [String] Gets the encryption keySource(provider). Possible
19
+ # values (case-insensitive): Microsoft.Storage
20
+ attr_accessor :key_source
21
+
22
+ #
23
+ # Validate the object. Throws ValidationError if validation fails.
24
+ #
25
+ def validate
26
+ fail MsRest::ValidationError, 'property key_source is nil' if @key_source.nil?
27
+ @services.validate unless @services.nil?
28
+ end
29
+
30
+ #
31
+ # Serializes given Model object into Ruby Hash.
32
+ # @param object Model object to serialize.
33
+ # @return [Hash] Serialized object in form of Ruby Hash.
34
+ #
35
+ def self.serialize_object(object)
36
+ object.validate
37
+ output_object = {}
38
+
39
+ serialized_property = object.key_source
40
+ output_object['keySource'] = serialized_property unless serialized_property.nil?
41
+
42
+ serialized_property = object.services
43
+ unless serialized_property.nil?
44
+ serialized_property = EncryptionServices.serialize_object(serialized_property)
45
+ end
46
+ output_object['services'] = 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 [Encryption] Deserialized object.
55
+ #
56
+ def self.deserialize_object(object)
57
+ return if object.nil?
58
+ output_object = Encryption.new
59
+
60
+ deserialized_property = object['keySource']
61
+ output_object.key_source = deserialized_property
62
+
63
+ deserialized_property = object['services']
64
+ unless deserialized_property.nil?
65
+ deserialized_property = EncryptionServices.deserialize_object(deserialized_property)
66
+ end
67
+ output_object.services = deserialized_property
68
+
69
+ output_object
70
+ end
71
+ end
72
+ end
73
+ end
@@ -0,0 +1,72 @@
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 encrypted service.
10
+ #
11
+ class EncryptionService
12
+
13
+ include MsRestAzure
14
+
15
+ # @return [Boolean] A boolean indicating whether or not the service is
16
+ # encrypted.
17
+ attr_accessor :enabled
18
+
19
+ # @return [DateTime] Gets a time value indicating when was the
20
+ # encryption enabled by the user last time. We return this value only
21
+ # when encryption is enabled. There might be some unencrypted blobs
22
+ # which were written after this time. This time is just to give a rough
23
+ # estimate of when encryption was enabled.
24
+ attr_accessor :last_enabled_time
25
+
26
+ #
27
+ # Validate the object. Throws ValidationError if validation fails.
28
+ #
29
+ def validate
30
+ # Nothing to validate
31
+ end
32
+
33
+ #
34
+ # Serializes given Model object into Ruby Hash.
35
+ # @param object Model object to serialize.
36
+ # @return [Hash] Serialized object in form of Ruby Hash.
37
+ #
38
+ def self.serialize_object(object)
39
+ object.validate
40
+ output_object = {}
41
+
42
+ serialized_property = object.enabled
43
+ output_object['enabled'] = serialized_property unless serialized_property.nil?
44
+
45
+ serialized_property = object.last_enabled_time
46
+ serialized_property = serialized_property.new_offset(0).strftime('%FT%TZ')
47
+ output_object['lastEnabledTime'] = 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 [EncryptionService] Deserialized object.
56
+ #
57
+ def self.deserialize_object(object)
58
+ return if object.nil?
59
+ output_object = EncryptionService.new
60
+
61
+ deserialized_property = object['enabled']
62
+ output_object.enabled = deserialized_property
63
+
64
+ deserialized_property = object['lastEnabledTime']
65
+ deserialized_property = DateTime.parse(deserialized_property) unless deserialized_property.to_s.empty?
66
+ output_object.last_enabled_time = deserialized_property
67
+
68
+ output_object
69
+ end
70
+ end
71
+ end
72
+ end
@@ -1,28 +1,25 @@
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
- # The access keys for the storage account.
9
+ # The encrypted services.
10
10
  #
11
- class StorageAccountKeys
11
+ class EncryptionServices
12
12
 
13
13
  include MsRestAzure
14
14
 
15
- # @return [String] Gets the value of key 1.
16
- attr_accessor :key1
17
-
18
- # @return [String] Gets the value of key 2.
19
- attr_accessor :key2
15
+ # @return [EncryptionService] The blob service.
16
+ attr_accessor :blob
20
17
 
21
18
  #
22
19
  # Validate the object. Throws ValidationError if validation fails.
23
20
  #
24
21
  def validate
25
- # Nothing to validate
22
+ @blob.validate unless @blob.nil?
26
23
  end
27
24
 
28
25
  #
@@ -34,11 +31,11 @@ module Azure::ARM::Storage
34
31
  object.validate
35
32
  output_object = {}
36
33
 
37
- serialized_property = object.key1
38
- output_object['key1'] = serialized_property unless serialized_property.nil?
39
-
40
- serialized_property = object.key2
41
- output_object['key2'] = serialized_property unless serialized_property.nil?
34
+ serialized_property = object.blob
35
+ unless serialized_property.nil?
36
+ serialized_property = EncryptionService.serialize_object(serialized_property)
37
+ end
38
+ output_object['blob'] = serialized_property unless serialized_property.nil?
42
39
 
43
40
  output_object
44
41
  end
@@ -46,17 +43,17 @@ module Azure::ARM::Storage
46
43
  #
47
44
  # Deserializes given Ruby Hash into Model object.
48
45
  # @param object [Hash] Ruby Hash object to deserialize.
49
- # @return [StorageAccountKeys] Deserialized object.
46
+ # @return [EncryptionServices] Deserialized object.
50
47
  #
51
48
  def self.deserialize_object(object)
52
49
  return if object.nil?
53
- output_object = StorageAccountKeys.new
54
-
55
- deserialized_property = object['key1']
56
- output_object.key1 = deserialized_property
50
+ output_object = EncryptionServices.new
57
51
 
58
- deserialized_property = object['key2']
59
- output_object.key2 = deserialized_property
52
+ deserialized_property = object['blob']
53
+ unless deserialized_property.nil?
54
+ deserialized_property = EncryptionService.deserialize_object(deserialized_property)
55
+ end
56
+ output_object.blob = deserialized_property
60
57
 
61
58
  output_object
62
59
  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
 
@@ -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 KeyPermission
10
+ #
11
+ module KeyPermission
12
+ READ = "READ"
13
+ FULL = "FULL"
14
+ end
15
+ end
16
+ 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 Kind
10
+ #
11
+ module Kind
12
+ Storage = "Storage"
13
+ BlobStorage = "BlobStorage"
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