Closed ghost closed 1 year ago
Solved the problematic firewalls: [{ id: 12345, status: "applied" }]
with a raw_data
on our Future object.
Accessing the Firewall object with server.public_net[:firewalls][0][:id] # type Firewall
would be weird. A user can expect to get the firewall on server.public_net[:firewalls][0]
. But then we lose the applied
status information.
Luckily, server.public_net[:firewalls][0]
does not really hold a Firewall
object, it holds a Future
which transparently forwards every method to a Firewall
object. I added a method raw_data
to this Future
, which returns the actual Hash/JSON data.
Users can now request the hidden data (e.g. applied
status) like this:
# basically a Firewall object (in reality a Future, but forwards everything to Firewall)
server.public_net[:firewalls][0]
# get the { id: 12345, status: 'applied' } hash
server.public_net[:firewalls][0].raw_data
Since this is still an MR from my fork and tests do not run. I think all tests should be green, at least they are locally:
bundle exec rubocop
: OKLEGACY_TESTS=y bundle exec rspec -t '~doubles'
: OKbundle exec rspec -t doubles --order rand
: OK
Implementing the missing features of existing resources (new actions, new attributes) in this PR.
List of requirements compiled from #30
Some server attributes have already been implemented before this PR.
(!) = Blocked by other PR
status
, which describes the relationship between the server and the firewall):id
key, so the parsed firewall object also is in the:id
keyTODO after #55 merged:
it_supports_search
to load balancer specit_supports_search
to load balancer type specCloses #30