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

Documentation incorrect. Parameter naming ambiguous. Error message misleading. #10

Open
snigel opened this issue May 10, 2022 · 0 comments

Comments

@snigel
Copy link

snigel commented May 10, 2022

What the documentation says:
--policy-set POLICY-SET (REQUIRED) Name of the Image Manager policy to manage

My test case:
A policy named my_policy_name with the policy id a1234567-a123-12ab-abcd-abcd123a12a1

What I expect
Running akamai image-manager with --policy-set my_policy_name should return data from my policy set.

What I get:

Policy: my_policy_name Network: both Output: text
ERROR: Call to /imaging/v2/network/staging/policies failed with a 400 result
ERROR: This indicates a problem with authentication or headers.
ERROR: Please ensure that the .edgerc file is formatted correctly.
ERROR: If you still have issues, please use gen_edgerc.py to generate the credentials
ERROR: Problem details: {'type': '/imaging/error-types/IVM_9000', 'title': 'Bad Request', 'instance': '/imaging/error-instances/12345-1234-1234-1234-12345', 'status': 400, 'detail': "Luna-Token 'my_policy_name' not configured for ContractID 'P-12345'", 'requestId': '12345'}

What I didn't expect
Running with id --policy-set a1234567-a123-12ab-abcd-abcd123a12a1 works as intended.

Fix suggestion:

  1. Make documentation and variable naming in line with what the code does.
  2. If possible, implement error messages for common scenarios, such as if the policy-set doesn't exist.
  3. Avoid ambiguous parameter names such as --policy-set, something like --policy-set-id is more specific.
  4. Avoid overly specific error messages while catching a broad range of errors. For example "This indicates a problem with authentication or headers." is misleading when it isn't the case, such as if the policy doesn't exist.
  5. The error message use gen_edgerc.py to generate the credentials. isn't very helpful, the file is not included with this plugin. A link to where that tool can be downloaded would be more helpful. https://github.com/akamai/httpie-edgegrid
  6. The error message Please ensure that the .edgerc file is formatted correctly. surprises me, wouldn't EdgeGridAuth throw an exception if the edgerc file couldn't be parsed? If I'm incorrect and that message is valid, it would be more helpful if a link to the documenation for setting up the .edgerc file was provided. https://developer.akamai.com/legacy/introduction/Conf_Client.html
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant