gitlab-fog-azure-rm 1.7.0 → 1.9.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (126) hide show
  1. checksums.yaml +4 -4
  2. data/.gitlab-ci.yml +12 -0
  3. data/.rubocop_todo.yml +1 -1
  4. data/CHANGELOG.md +4 -0
  5. data/gitlab-fog-azure-rm.gemspec +3 -3
  6. data/lib/fog/azurerm/constants.rb +0 -6
  7. data/lib/fog/azurerm/custom_fog_errors.rb +0 -41
  8. data/lib/fog/azurerm/docs/storage.md +1 -1
  9. data/lib/fog/azurerm/identity_encoding_filter.rb +12 -0
  10. data/lib/fog/azurerm/models/storage/directories.rb +6 -6
  11. data/lib/fog/azurerm/models/storage/directory.rb +4 -4
  12. data/lib/fog/azurerm/models/storage/file.rb +6 -3
  13. data/lib/fog/azurerm/models/storage/files.rb +8 -8
  14. data/lib/fog/azurerm/models/storage/storage_account.rb +4 -4
  15. data/lib/fog/azurerm/models/storage/storage_accounts.rb +6 -6
  16. data/lib/fog/azurerm/requests/storage/acquire_blob_lease.rb +2 -2
  17. data/lib/fog/azurerm/requests/storage/acquire_container_lease.rb +2 -2
  18. data/lib/fog/azurerm/requests/storage/check_container_exists.rb +2 -2
  19. data/lib/fog/azurerm/requests/storage/commit_blob_blocks.rb +2 -2
  20. data/lib/fog/azurerm/requests/storage/compare_container_blobs.rb +2 -2
  21. data/lib/fog/azurerm/requests/storage/copy_blob.rb +2 -2
  22. data/lib/fog/azurerm/requests/storage/copy_blob_from_uri.rb +2 -2
  23. data/lib/fog/azurerm/requests/storage/copy_object.rb +2 -2
  24. data/lib/fog/azurerm/requests/storage/create_block_blob.rb +2 -2
  25. data/lib/fog/azurerm/requests/storage/create_container.rb +2 -2
  26. data/lib/fog/azurerm/requests/storage/create_page_blob.rb +2 -2
  27. data/lib/fog/azurerm/requests/storage/delete_blob.rb +2 -2
  28. data/lib/fog/azurerm/requests/storage/delete_blob_https_url.rb +4 -4
  29. data/lib/fog/azurerm/requests/storage/delete_container.rb +2 -2
  30. data/lib/fog/azurerm/requests/storage/delete_object.rb +2 -2
  31. data/lib/fog/azurerm/requests/storage/delete_object_url.rb +2 -2
  32. data/lib/fog/azurerm/requests/storage/get_blob.rb +2 -2
  33. data/lib/fog/azurerm/requests/storage/get_blob_http_url.rb +5 -5
  34. data/lib/fog/azurerm/requests/storage/get_blob_https_url.rb +6 -5
  35. data/lib/fog/azurerm/requests/storage/get_blob_properties.rb +2 -2
  36. data/lib/fog/azurerm/requests/storage/get_blob_url.rb +4 -4
  37. data/lib/fog/azurerm/requests/storage/get_container_acl.rb +2 -2
  38. data/lib/fog/azurerm/requests/storage/get_container_properties.rb +2 -2
  39. data/lib/fog/azurerm/requests/storage/get_container_url.rb +4 -4
  40. data/lib/fog/azurerm/requests/storage/get_object.rb +2 -2
  41. data/lib/fog/azurerm/requests/storage/get_object_url.rb +2 -2
  42. data/lib/fog/azurerm/requests/storage/list_blobs.rb +2 -2
  43. data/lib/fog/azurerm/requests/storage/list_containers.rb +2 -2
  44. data/lib/fog/azurerm/requests/storage/put_blob_block.rb +2 -2
  45. data/lib/fog/azurerm/requests/storage/put_blob_http_url.rb +39 -0
  46. data/lib/fog/azurerm/requests/storage/put_blob_https_url.rb +4 -4
  47. data/lib/fog/azurerm/requests/storage/put_blob_metadata.rb +2 -2
  48. data/lib/fog/azurerm/requests/storage/put_blob_pages.rb +2 -2
  49. data/lib/fog/azurerm/requests/storage/put_blob_properties.rb +2 -2
  50. data/lib/fog/azurerm/requests/storage/put_container_acl.rb +2 -2
  51. data/lib/fog/azurerm/requests/storage/put_container_metadata.rb +2 -2
  52. data/lib/fog/azurerm/requests/storage/put_object_url.rb +2 -2
  53. data/lib/fog/azurerm/requests/storage/release_blob_lease.rb +2 -2
  54. data/lib/fog/azurerm/requests/storage/release_container_lease.rb +2 -2
  55. data/lib/fog/azurerm/requests/storage/save_page_blob.rb +2 -2
  56. data/lib/fog/azurerm/requests/storage/wait_blob_copy_operation_to_finish.rb +2 -2
  57. data/lib/fog/azurerm/storage.rb +62 -27
  58. data/lib/fog/azurerm/utilities/general.rb +2 -58
  59. data/lib/fog/azurerm/version.rb +1 -1
  60. data/lib/fog/azurerm.rb +4 -11
  61. data/rakefile +4 -5
  62. data/test/api_stub/models/storage/directory.rb +1 -1
  63. data/test/api_stub/models/storage/file.rb +1 -1
  64. data/test/api_stub/requests/storage/directory.rb +1 -1
  65. data/test/api_stub/requests/storage/file.rb +4 -4
  66. data/test/integration/README.md +5 -7
  67. data/test/integration/blob.rb +28 -36
  68. data/test/integration/container.rb +8 -39
  69. data/test/integration/credentials/azure.yml +4 -5
  70. data/test/models/storage/test_directories.rb +5 -5
  71. data/test/models/storage/test_directory.rb +2 -2
  72. data/test/models/storage/test_file.rb +16 -4
  73. data/test/models/storage/test_files.rb +8 -8
  74. data/test/requests/storage/test_acquire_blob_lease.rb +2 -2
  75. data/test/requests/storage/test_acquire_container_lease.rb +2 -2
  76. data/test/requests/storage/test_check_container_exists.rb +1 -1
  77. data/test/requests/storage/test_commit_blob_blocks.rb +2 -2
  78. data/test/requests/storage/test_compare_container_blobs.rb +2 -2
  79. data/test/requests/storage/test_copy_blob.rb +2 -2
  80. data/test/requests/storage/test_copy_blob_from_uri.rb +2 -2
  81. data/test/requests/storage/test_create_block_blob.rb +2 -2
  82. data/test/requests/storage/test_create_container.rb +2 -2
  83. data/test/requests/storage/test_create_page_blob.rb +2 -2
  84. data/test/requests/storage/test_delete_blob.rb +2 -2
  85. data/test/requests/storage/test_delete_blob_https_url.rb +7 -10
  86. data/test/requests/storage/test_delete_container.rb +2 -2
  87. data/test/requests/storage/test_delete_object.rb +2 -2
  88. data/test/requests/storage/test_get_blob.rb +2 -2
  89. data/test/requests/storage/test_get_blob_encoding.rb +45 -0
  90. data/test/requests/storage/test_get_blob_http_url.rb +13 -9
  91. data/test/requests/storage/test_get_blob_https_url.rb +95 -13
  92. data/test/requests/storage/test_get_blob_properties.rb +2 -2
  93. data/test/requests/storage/test_get_blob_url.rb +15 -24
  94. data/test/requests/storage/test_get_container_acl.rb +2 -2
  95. data/test/requests/storage/test_get_container_properties.rb +2 -2
  96. data/test/requests/storage/test_get_container_url.rb +5 -8
  97. data/test/requests/storage/test_get_object.rb +2 -2
  98. data/test/requests/storage/test_list_blobs.rb +2 -2
  99. data/test/requests/storage/test_list_containers.rb +2 -2
  100. data/test/requests/storage/test_put_blob_block.rb +2 -2
  101. data/test/requests/storage/test_put_blob_http_url.rb +33 -0
  102. data/test/requests/storage/test_put_blob_https_url.rb +8 -11
  103. data/test/requests/storage/test_put_blob_metadata.rb +2 -2
  104. data/test/requests/storage/test_put_blob_pages.rb +2 -2
  105. data/test/requests/storage/test_put_blob_properties.rb +2 -2
  106. data/test/requests/storage/test_put_container_acl.rb +2 -2
  107. data/test/requests/storage/test_put_container_metadata.rb +2 -2
  108. data/test/requests/storage/test_release_blob_lease.rb +2 -2
  109. data/test/requests/storage/test_release_container_lease.rb +2 -2
  110. data/test/requests/storage/test_save_page_blob.rb +2 -2
  111. data/test/requests/storage/test_wait_blob_copy_operation_to_finish.rb +15 -6
  112. data/test/test_helper.rb +38 -698
  113. metadata +27 -36
  114. data/lib/fog/azurerm/credentials.rb +0 -44
  115. data/lib/fog/azurerm/models/resources/azure_resource.rb +0 -25
  116. data/lib/fog/azurerm/models/resources/azure_resources.rb +0 -40
  117. data/lib/fog/azurerm/models/resources/dependency.rb +0 -27
  118. data/lib/fog/azurerm/models/resources/deployment.rb +0 -65
  119. data/lib/fog/azurerm/models/resources/deployments.rb +0 -30
  120. data/lib/fog/azurerm/models/resources/provider.rb +0 -27
  121. data/lib/fog/azurerm/models/resources/provider_resource_type.rb +0 -22
  122. data/lib/fog/azurerm/models/resources/resource_group.rb +0 -34
  123. data/lib/fog/azurerm/models/resources/resource_groups.rb +0 -29
  124. data/test/integration/storage_account.rb +0 -135
  125. data/test/smoke_tests/compute/test_resource_group_smoke.rb +0 -37
  126. data/test/test_credentials.rb +0 -63
@@ -1,37 +0,0 @@
1
- require 'fog/azurerm'
2
- require 'minitest/autorun'
3
- # Integration smoke test class to test resource group
4
- class TestResourceGroupSmoke < MiniTest::Test
5
- def setup
6
- if !ENV['TENANT_ID'].nil? && !ENV['CLIENT_ID'].nil? && !ENV['CLIENT_SECRET'].nil? && !ENV['SUBSCRIPTION_ID'].nil?
7
- @resource = Fog::Resources::AzureRM.new(
8
- tenant_id: ENV['TENANT_ID'],
9
- client_id: ENV['CLIENT_ID'],
10
- client_secret: ENV['CLIENT_SECRET'],
11
- subscription_id: ENV['SUBSCRIPTION_ID']
12
- )
13
- else
14
- azure_credentials = YAML.load_file('../../integration/credentials/azure.yml')
15
- @resource = Fog::Resources::AzureRM.new(
16
- tenant_id: azure_credentials['tenant_id'],
17
- client_id: azure_credentials['client_id'],
18
- client_secret: azure_credentials['client_secret'],
19
- subscription_id: azure_credentials['subscription_id']
20
- )
21
- end
22
- time = Time.now.to_f.to_s
23
- new_time = time.split(/\W+/).join
24
- @resource_group_name = "fog-smoke-test-rg-#{new_time}"
25
- end
26
-
27
- def test_resource_group
28
- puts 'In Smoke tests'
29
- resource_group = @resource.resource_groups.create(name: @resource_group_name, location: 'eastus')
30
- assert_instance_of Fog::Resources::AzureRM::ResourceGroup, resource_group
31
-
32
- resource_group = @resource.resource_groups.get(@resource_group_name)
33
- assert_instance_of Fog::Resources::AzureRM::ResourceGroup, resource_group
34
-
35
- resource_group.destroy
36
- end
37
- end
@@ -1,63 +0,0 @@
1
- require File.expand_path 'test_helper', __dir__
2
-
3
- # Test class for Credentials Helper Class
4
- class TestCredentials < Minitest::Test
5
- def setup
6
- @creds = credentials
7
- end
8
-
9
- def test_methods
10
- methods = [
11
- :get_credentials,
12
- :get_token
13
- ]
14
- methods.each do |method|
15
- assert Fog::Credentials::AzureRM.respond_to? method
16
- end
17
- end
18
-
19
- def test_get_credentials_method_with_same_client
20
- cred_obj_one = Fog::Credentials::AzureRM.get_credentials(@creds[:tenant_id], @creds[:client_id], @creds[:client_secret])
21
- cred_obj_two = Fog::Credentials::AzureRM.get_credentials(@creds[:tenant_id], @creds[:client_id], @creds[:client_secret])
22
- assert_equal cred_obj_one.object_id, cred_obj_two.object_id
23
- end
24
-
25
- def test_get_credentials_method_with_different_client
26
- cred_obj_one = Fog::Credentials::AzureRM.get_credentials(@creds[:tenant_id], @creds[:client_id], @creds[:client_secret])
27
- @creds[:client_id] = '<NEW-CLIENT-ID>'
28
- cred_obj_two = Fog::Credentials::AzureRM.get_credentials(@creds[:tenant_id], @creds[:client_id], @creds[:client_secret])
29
- refute_equal cred_obj_one.object_id, cred_obj_two.object_id
30
- end
31
-
32
- def test_get_token_method_with_default_environment
33
- Fog::Credentials::AzureRM.get_credentials(@creds[:tenant_id], @creds[:client_id], @creds[:client_secret])
34
- token_provider = Fog::Credentials::AzureRM.instance_variable_get(:@token_provider)
35
- token_provider.stub :get_authentication_header, 'Bearer <some-token>' do
36
- assert_equal Fog::Credentials::AzureRM.get_token(@creds[:tenant_id], @creds[:client_id], @creds[:client_secret]), 'Bearer <some-token>'
37
- end
38
- end
39
-
40
- def test_get_token_method_with_china_environment
41
- Fog::Credentials::AzureRM.get_credentials(@creds[:tenant_id], @creds[:client_id], @creds[:client_secret], Fog::AzureRM::ENVIRONMENT_AZURE_CHINA_CLOUD)
42
- token_provider = Fog::Credentials::AzureRM.instance_variable_get(:@token_provider)
43
- token_provider.stub :get_authentication_header, 'Bearer <some-token>' do
44
- assert_equal Fog::Credentials::AzureRM.get_token(@creds[:tenant_id], @creds[:client_id], @creds[:client_secret]), 'Bearer <some-token>'
45
- end
46
- end
47
-
48
- def test_get_token_method_with_us_government_environment
49
- Fog::Credentials::AzureRM.get_credentials(@creds[:tenant_id], @creds[:client_id], @creds[:client_secret], Fog::AzureRM::ENVIRONMENT_AZURE_US_GOVERNMENT)
50
- token_provider = Fog::Credentials::AzureRM.instance_variable_get(:@token_provider)
51
- token_provider.stub :get_authentication_header, 'Bearer <some-token>' do
52
- assert_equal Fog::Credentials::AzureRM.get_token(@creds[:tenant_id], @creds[:client_id], @creds[:client_secret]), 'Bearer <some-token>'
53
- end
54
- end
55
-
56
- def test_get_token_method_with_german_environment
57
- Fog::Credentials::AzureRM.get_credentials(@creds[:tenant_id], @creds[:client_id], @creds[:client_secret], Fog::AzureRM::ENVIRONMENT_AZURE_GERMAN_CLOUD)
58
- token_provider = Fog::Credentials::AzureRM.instance_variable_get(:@token_provider)
59
- token_provider.stub :get_authentication_header, 'Bearer <some-token>' do
60
- assert_equal Fog::Credentials::AzureRM.get_token(@creds[:tenant_id], @creds[:client_id], @creds[:client_secret]), 'Bearer <some-token>'
61
- end
62
- end
63
- end