Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Network_Firewall_AccessControlList service not respecting new object mask #48

Open
cbreden opened this issue Aug 2, 2014 · 6 comments

Comments

@cbreden
Copy link

cbreden commented Aug 2, 2014

We are finally getting around to merging our own api wrapper with the 2.x+ gem here so we can start work on the new semantic models, but we're hitting a few bumps.

We've found at least one service that seems to ignore the new object mask string. Here's some test code that isolates this behavior along with the outputs.

## vvvvv Comment in/out gem version along with appropriate object mask

#gem 'softlayer_api', '=1.0.7'
#OBJECT_MASK = { 'id' => '', 'rules' => { 'id' => ''} }

#gem 'softlayer_api', '=2.1.1'
#OBJECT_MASK = "mask[ id, rules [ id ] ]"

## ^^^^^ Comment in/out gem version along with appropriate object mask 

require 'softlayer_api'
require 'pp'

user = "abc" 
api_key  = "xyzxyz"
firewall_id = 2132  # provide a valid firewall ID

service = SoftLayer::Service.new("SoftLayer_Network_Firewall_AccessControlList", :username => user, :api_key => api_key)
result = service.object_mask(OBJECT_MASK).object_with_id(firewall_id).getObject
pp result
with v1.0.7:
{"id"=>2132,
 "rules"=>
  [{"id"=>1273226},
   {"id"=>1273228},
   {"id"=>1273230},
   {"id"=>1273232},
......
with v2.1.1:
{"direction"=>"in", "firewallContextInterfaceId"=>4235, "id"=>2132}

We haven't found any way to get this mask to work.

@SLsthompson
Copy link
Collaborator

After some discussion with the development team, this appears to be a bug in the way extended object masks are applied to "getObject" calls. The work around would be to use object masks in the "old" format (which the current Ruby client will not allow you to do). Or to make a separate call to request the rules of the ACL directly

service.object_with_id(firewall_id).object_mask("mask.id").getRules

Given that information... it may be most prudent to add some mechanism to the gem that allows you to provide object masks in the 'old' format if you wish.

@cbreden
Copy link
Author

cbreden commented Aug 4, 2014

Do you have any idea if the bug will be addressed by the dev team soon? This is the main issue holding us back at the moment. While I'm not opposed to an interim fix that accepts the old mask, it would get messy to bounce between the two masks constantly.

@SLsthompson
Copy link
Collaborator

I do not have any information about how (or when) the bug might be addressed by the development team.

@SLsthompson
Copy link
Collaborator

The bug concerning the application of object_masks in the getObject call has been addressed and passed QE. It still must work it's way through the production process, but should be in place next week.

@cbreden
Copy link
Author

cbreden commented Aug 7, 2014

That's great news, thank you.

@SLsthompson
Copy link
Collaborator

The bug fix for using extended object masks with the firewall rules is released and in production. Please re-visit the issue and let me know if it still does not work for you.

I noticed and reported a similar problem where using a mask while calling "getRules" for a server firewall does not apply the mask to the rules (you always get back the full set of information).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants