akamai / cli-property-manager

Use this Property Manager CLI to automate Akamai property changes and deployments across many environments.
Apache License 2.0
29 stars 22 forks source link

show-ruletree doesn't seem to work #31

Closed javiergarza closed 2 years ago

javiergarza commented 5 years ago

The show-ruletree does not seem to work

$ akamai pm search jgarza-sf [ { "accountId": "act_B-C-1FRYVMN", "contractId": "ctr_C-1FRYVV3", "assetId": "aid_10601006", "groupId": "grp_123081", "propertyId": "prp_490896", "propertyName": "jgarza-sf", "propertyVersion": 1, "updatedByUser": "siltkuupm6uagdnc", "updatedDate": "2018-10-09T17:27:37Z", "productionStatus": "INACTIVE", "stagingStatus": "ACTIVE" } ]

$ akamai pm show-ruletree -p jgarza-sf PM CLI Error: 'unknown_pm_cli_property' occurred: PM CLI property 'jgarza-sf' doesn't exist!

Just curious, why in some commands like search you just type the property and in other commands like show-ruletree you have to specify --property (-p)?

humanshield314 commented 5 years ago

Hi Javier

I'm sorry this is confusing and not seemingly consistent! I agree this is a weird discrepancy.

In your specific example, based on the usage and the error message for -p jgarza-sf, it implies you dont have a pm cli property called jgarza-sf, even though it exists in property manager.

I would suggest you to do a akamai pm import -p jgarza-sf, and if you did the 'show-ruletree' command again it should work.

The search functionality is meant to search akamai for the properties that you have access to from property manager. This is why the property is a parameter, and not an option. I believe this was the original reason for this. I believe search is the only command to take a property parameter instead of a property option.

DidierFort commented 5 years ago

Hi James,

But the current search function only accepts exact match, whereas in Luna, I can search on partial name, host names or CP codes, including groups.

So in that sense, I agree with @javiergarza, the current search function is more like give me the latest version of an existing property not really a search.

It should be renamed status.

Regards, Didier

humanshield314 commented 5 years ago

I think it's important to remember we are talking about two different commands here. The "show rule tree" only works with the latest version of the property that you have locally from pmcli.

The search is an exact match or search on property name for properties that you have access to. If you want a search feature on other criteria we should consider adding that functionality

javiergarza commented 5 years ago

James, can we please update the online CLI help to indicate the show-ruletree works on a local environment only?

For example instead of: show-ruletree|sr [options] Fetch latest version of property rule tree

we could have something like: show-ruletree|sr [options] Shows the rule tree of a local property you previously imported

(and of course update the same text for the "show-ruletree --help"

Actually the sandbox CLI has a similar method which is called "rules". It would be great if we could have standardized nouns across the different Akamai CLI packages which provide similar functionality

An It would be awesome to add a new command called "retrieve" that would allow to pull the JSON rules of any given remote property (to provide parity to what the property CLI does). I will file a new issue to track that separately if you like (although I am guessing it is already in the roadmap)