Skip to content

Commit

Permalink
Merge pull request #224 from Autosde/ofer/799542-physical-storage-capa
Browse files Browse the repository at this point in the history
Ofer/799542 physical storage capabilities
  • Loading branch information
agrare committed Mar 30, 2023
2 parents 2e70e6a + f919d70 commit c38d6b4
Show file tree
Hide file tree
Showing 7 changed files with 41 additions and 33 deletions.
Expand Up @@ -49,7 +49,8 @@ def physical_storages
:name => storage.name,
:ems_ref => storage.uuid,
:physical_storage_family => persister.physical_storage_families.lazy_find(storage.system_type.uuid),
:health_state => storage.status
:health_state => storage.status,
:capabilities => parse_possible_capabilities(storage.capability_values_json, 'abstract_capability')
)
persister.physical_storage_details.build(:resource => physical_storage, :model => storage.system_type.name)
end
Expand Down
Expand Up @@ -48,7 +48,7 @@
it "creates volume on storage system -autosde gem v1" do
# retrieve storage system
storage_systems = nil
# @type [Array<AutosdeOpenapiClient::StorageSystem>]
# @type [Array<AutosdeOpenapiClient::StorageSystemResponse>]
VCR.use_cassette("get_storage_system_v1") do
storage_systems = client.StorageSystemApi.storage_systems_get
expect(storage_systems).to(be_an_instance_of(Array))
Expand Down Expand Up @@ -114,7 +114,7 @@
it "creates volume on storage system -autosde gem v2" do
# retrieve storage system
storage_systems = nil
# @type [Array<AutosdeOpenapiClient::StorageSystem>]
# @type [Array<AutosdeOpenapiClient::StorageSystemResponse>]
VCR.use_cassette("get_storage_system_v2", :record => :once) do
storage_systems = client.StorageSystemApi.storage_systems_get
expect(storage_systems).to(be_an_instance_of(Array))
Expand Down
Expand Up @@ -47,20 +47,21 @@
.to(receive(:storage_systems_get)
.and_return(
[
AutosdeOpenapiClient::StorageSystem.new(
:component_state => "PENDING_CREATION",
:management_ip => "9.151.159.178",
:name => "9.151.159.178",
:status => "ONLINE",
:storage_family => "ontap_7mode",
:system_type => AutosdeOpenapiClient::SystemType.new(
:component_state => "PENDING_CREATION",
:name => "IBM_FlashSystems",
:short_version => "11",
:uuid => "053446df-ed2b-4822-b9c5-386e85198519",
:version => "1.2"
AutosdeOpenapiClient::StorageSystemResponse.new(
:component_state => "PENDING_CREATION",
:management_ip => "9.151.159.178",
:name => "9.151.159.178",
:status => "ONLINE",
:storage_family => "ontap_7mode",
:system_type => AutosdeOpenapiClient::SystemType.new(
:component_state => "PENDING_CREATION",
:name => "IBM_FlashSystems",
:short_version => "11",
:uuid => "053446df-ed2b-4822-b9c5-386e85198519",
:version => "1.2"
),
:uuid => "980f3ceb-c599-49c4-9db3-fdc793cb8666"
:capability_values_json => "[{\"abstract_capability\": \"compression\", \"value\": \"True\", \"uuid\": \"699f2dee-7cd9-4ac0-ab20-41aea6c74475\"}, {\"abstract_capability\": \"compression\", \"value\": \"False\", \"uuid\": \"3f44f8ae-9854-4dbf-b375-8b41766f7b2e\"}, {\"abstract_capability\": \"thin_provision\", \"value\": \"True\", \"uuid\": \"ea84a958-f4bc-4d8d-9a68-07312ec25c87\"}, {\"abstract_capability\": \"thin_provision\", \"value\": \"False\", \"uuid\": \"18b861c0-e205-4dd9-b207-c155e5d7cf91\"}]",
:uuid => "980f3ceb-c599-49c4-9db3-fdc793cb8666"
)
]
))
Expand All @@ -73,20 +74,21 @@
.to(receive(:storage_systems_get)
.and_return(
[
AutosdeOpenapiClient::StorageSystem.new(
:component_state => "PENDING_CREATION",
:management_ip => "1.2.3.4",
:name => "1.2.3.4",
:status => "ONLINE",
:storage_family => "ontap_7mode",
:system_type => AutosdeOpenapiClient::SystemType.new(
:component_state => "PENDING_CREATION",
:name => "IBM_FlashSystems",
:short_version => "11",
:uuid => "053446df-ed2b-4822-b9c5-386e85198519",
:version => "1.2"
AutosdeOpenapiClient::StorageSystemResponse.new(
:component_state => "PENDING_CREATION",
:management_ip => "1.2.3.4",
:name => "1.2.3.4",
:status => "ONLINE",
:storage_family => "ontap_7mode",
:system_type => AutosdeOpenapiClient::SystemType.new(
:component_state => "PENDING_CREATION",
:name => "IBM_FlashSystems",
:short_version => "11",
:uuid => "053446df-ed2b-4822-b9c5-386e85198519",
:version => "1.2"
),
:uuid => "3923aeca-0b22-4f5b-a15f-9c844bc9abcb"
:capability_values_json => "[{\"abstract_capability\": \"compression\", \"value\": \"True\", \"uuid\": \"699f2dee-7cd9-4ac0-ab20-41aea6c74475\"}, {\"abstract_capability\": \"compression\", \"value\": \"False\", \"uuid\": \"3f44f8ae-9854-4dbf-b375-8b41766f7b2e\"}, {\"abstract_capability\": \"thin_provision\", \"value\": \"True\", \"uuid\": \"ea84a958-f4bc-4d8d-9a68-07312ec25c87\"}, {\"abstract_capability\": \"thin_provision\", \"value\": \"False\", \"uuid\": \"18b861c0-e205-4dd9-b207-c155e5d7cf91\"}]",
:uuid => "3923aeca-0b22-4f5b-a15f-9c844bc9abcb"
)
]
))
Expand All @@ -102,7 +104,8 @@
:name => "1.2.3.4",
:type => "ManageIQ::Providers::Autosde::StorageManager::PhysicalStorage",
:health_state => "ONLINE",
:physical_storage_family => ems.physical_storage_families.find_by(:name => "IBM_FlashSystems")
:physical_storage_family => ems.physical_storage_families.find_by(:name => "IBM_FlashSystems"),
:capabilities => {"compression"=>["True", "False"], "thin_provision"=>["True", "False"]},
))
end

Expand Down
Expand Up @@ -61,6 +61,7 @@
:uuid => "397352fb-f6a0-4a5d-90f8-6addf4c81076",
:version => "1.1"
),
:capabilities => {"compression": ["True", "False"], "thin_provision": ["True", "False"]},
:uuid => "78ef7ca4-2ce9-4983-aa49-76dbeedcbedf"
)
]
Expand All @@ -86,6 +87,7 @@
:uuid => "053446df-ed2b-4822-b9c5-386e85198519",
:version => "1.1"
),
:capabilities => {"compression": ["True", "False"], "thin_provision": ["True", "False"]},
:uuid => "3923aeca-0b22-4f5b-a15f-9c844bc9abcb"
)
]
Expand All @@ -102,6 +104,7 @@
:name => "Barmetall9_SVC",
:type => "ManageIQ::Providers::Autosde::StorageManager::PhysicalStorage",
:health_state => "ONLINE",
:capabilities => {"compression": ["True", "False"], "thin_provision": ["True", "False"]},
:physical_storage_family => ems.physical_storage_families.find_by(:name => "IBM_FlashSystems")
))
end
Expand Down Expand Up @@ -251,6 +254,7 @@ def assert_specific_physical_storage
:canister_slots => nil,
:physical_chassis_id => nil,
:total_space => nil,
:capabilities => {"compression": ["True", "False"], "thin_provision": ["True", "False"]},
:physical_storage_family => ems.physical_storage_families.find_by(:name => "IBM_FlashSystems")
))
end
Expand Down
2 changes: 1 addition & 1 deletion spec/vcr_cassettes/ems_refresh_v1.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion spec/vcr_cassettes/get_storage_system_v1.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion spec/vcr_cassettes/get_storage_system_v2.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit c38d6b4

Please sign in to comment.